mirror of
https://github.com/sehugg/mango_one.git
synced 2025-03-03 02:31:18 +00:00
initial import from 8bitworkshop.com
This commit is contained in:
parent
38c9081f3f
commit
7caeaa4cd7
278
font_cp437_8x8.v
Normal file
278
font_cp437_8x8.v
Normal file
@ -0,0 +1,278 @@
|
|||||||
|
|
||||||
|
`ifndef FONT_CP437_H
|
||||||
|
`define FONT_CP437_H
|
||||||
|
|
||||||
|
// PC font (code page 437)
|
||||||
|
|
||||||
|
module font_cp437_8x8(addr, data);
|
||||||
|
|
||||||
|
input [10:0] addr;
|
||||||
|
output [7:0] data;
|
||||||
|
|
||||||
|
reg [7:0] bitarray[0:2047];
|
||||||
|
|
||||||
|
assign data = bitarray[addr];
|
||||||
|
|
||||||
|
initial begin/*{w:8,h:8,bpp:1,count:256}*/
|
||||||
|
bitarray = '{
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00, //0
|
||||||
|
8'h7e,8'h81,8'ha5,8'h81,8'hbd,8'h99,8'h81,8'h7e, //1
|
||||||
|
8'h7e,8'hff,8'hdb,8'hff,8'hc3,8'he7,8'hff,8'h7e, //2
|
||||||
|
8'h6c,8'hfe,8'hfe,8'hfe,8'h7c,8'h38,8'h10,8'h00, //3
|
||||||
|
8'h10,8'h38,8'h7c,8'hfe,8'h7c,8'h38,8'h10,8'h00, //4
|
||||||
|
8'h38,8'h7c,8'h38,8'hfe,8'hfe,8'hd6,8'h10,8'h38, //5
|
||||||
|
8'h10,8'h10,8'h38,8'h7c,8'hfe,8'h7c,8'h10,8'h38, //6
|
||||||
|
8'h00,8'h00,8'h18,8'h3c,8'h3c,8'h18,8'h00,8'h00, //7
|
||||||
|
8'hff,8'hff,8'he7,8'hc3,8'hc3,8'he7,8'hff,8'hff, //8
|
||||||
|
8'h00,8'h3c,8'h66,8'h42,8'h42,8'h66,8'h3c,8'h00, //9
|
||||||
|
8'hff,8'hc3,8'h99,8'hbd,8'hbd,8'h99,8'hc3,8'hff, //10
|
||||||
|
8'h0f,8'h07,8'h0f,8'h7d,8'hcc,8'hcc,8'hcc,8'h78, //11
|
||||||
|
8'h3c,8'h66,8'h66,8'h66,8'h3c,8'h18,8'h7e,8'h18, //12
|
||||||
|
8'h3f,8'h33,8'h3f,8'h30,8'h30,8'h70,8'hf0,8'he0, //13
|
||||||
|
8'h7f,8'h63,8'h7f,8'h63,8'h63,8'h67,8'he6,8'hc0, //14
|
||||||
|
8'h99,8'h5a,8'h3c,8'he7,8'he7,8'h3c,8'h5a,8'h99, //15
|
||||||
|
8'h80,8'he0,8'hf8,8'hfe,8'hf8,8'he0,8'h80,8'h00, //16
|
||||||
|
8'h02,8'h0e,8'h3e,8'hfe,8'h3e,8'h0e,8'h02,8'h00, //17
|
||||||
|
8'h18,8'h3c,8'h7e,8'h18,8'h18,8'h7e,8'h3c,8'h18, //18
|
||||||
|
8'h66,8'h66,8'h66,8'h66,8'h66,8'h00,8'h66,8'h00, //19
|
||||||
|
8'h7f,8'hdb,8'hdb,8'h7b,8'h1b,8'h1b,8'h1b,8'h00, //20
|
||||||
|
8'h7e,8'hc3,8'h78,8'hcc,8'hcc,8'h78,8'h8c,8'hf8, //21
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'h7e,8'h7e,8'h7e,8'h00, //22
|
||||||
|
8'h18,8'h3c,8'h7e,8'h18,8'h7e,8'h3c,8'h18,8'hff, //23
|
||||||
|
8'h18,8'h3c,8'h7e,8'h18,8'h18,8'h18,8'h18,8'h00, //24
|
||||||
|
8'h18,8'h18,8'h18,8'h18,8'h7e,8'h3c,8'h18,8'h00, //25
|
||||||
|
8'h00,8'h18,8'h0c,8'hfe,8'h0c,8'h18,8'h00,8'h00, //26
|
||||||
|
8'h00,8'h30,8'h60,8'hfe,8'h60,8'h30,8'h00,8'h00, //27
|
||||||
|
8'h00,8'h00,8'hc0,8'hc0,8'hc0,8'hfe,8'h00,8'h00, //28
|
||||||
|
8'h00,8'h24,8'h66,8'hff,8'h66,8'h24,8'h00,8'h00, //29
|
||||||
|
8'h00,8'h18,8'h3c,8'h7e,8'hff,8'hff,8'h00,8'h00, //30
|
||||||
|
8'h00,8'hff,8'hff,8'h7e,8'h3c,8'h18,8'h00,8'h00, //31
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00, //32
|
||||||
|
8'h30,8'h78,8'h78,8'h30,8'h30,8'h00,8'h30,8'h00, //33
|
||||||
|
8'h6c,8'h6c,8'h6c,8'h00,8'h00,8'h00,8'h00,8'h00, //34
|
||||||
|
8'h6c,8'h6c,8'hfe,8'h6c,8'hfe,8'h6c,8'h6c,8'h00, //35
|
||||||
|
8'h30,8'h7c,8'hc0,8'h78,8'h0c,8'hf8,8'h30,8'h00, //36
|
||||||
|
8'h00,8'hc6,8'hcc,8'h18,8'h30,8'h66,8'hc6,8'h00, //37
|
||||||
|
8'h38,8'h6c,8'h38,8'h76,8'hdc,8'hcc,8'h76,8'h00, //38
|
||||||
|
8'h60,8'h60,8'hc0,8'h00,8'h00,8'h00,8'h00,8'h00, //39
|
||||||
|
8'h18,8'h30,8'h60,8'h60,8'h60,8'h30,8'h18,8'h00, //40
|
||||||
|
8'h60,8'h30,8'h18,8'h18,8'h18,8'h30,8'h60,8'h00, //41
|
||||||
|
8'h00,8'h66,8'h3c,8'hff,8'h3c,8'h66,8'h00,8'h00, //42
|
||||||
|
8'h00,8'h30,8'h30,8'hfc,8'h30,8'h30,8'h00,8'h00, //43
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'h00,8'h70,8'h30,8'h60, //44
|
||||||
|
8'h00,8'h00,8'h00,8'hfc,8'h00,8'h00,8'h00,8'h00, //45
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'h00,8'h30,8'h30,8'h00, //46
|
||||||
|
8'h06,8'h0c,8'h18,8'h30,8'h60,8'hc0,8'h80,8'h00, //47
|
||||||
|
8'h78,8'hcc,8'hdc,8'hfc,8'hec,8'hcc,8'h78,8'h00, //48
|
||||||
|
8'h30,8'hf0,8'h30,8'h30,8'h30,8'h30,8'hfc,8'h00, //49
|
||||||
|
8'h78,8'hcc,8'h0c,8'h38,8'h60,8'hcc,8'hfc,8'h00, //50
|
||||||
|
8'h78,8'hcc,8'h0c,8'h38,8'h0c,8'hcc,8'h78,8'h00, //51
|
||||||
|
8'h1c,8'h3c,8'h6c,8'hcc,8'hfe,8'h0c,8'h0c,8'h00, //52
|
||||||
|
8'hfc,8'hc0,8'hf8,8'h0c,8'h0c,8'hcc,8'h78,8'h00, //53
|
||||||
|
8'h38,8'h60,8'hc0,8'hf8,8'hcc,8'hcc,8'h78,8'h00, //54
|
||||||
|
8'hfc,8'hcc,8'h0c,8'h18,8'h30,8'h60,8'h60,8'h00, //55
|
||||||
|
8'h78,8'hcc,8'hcc,8'h78,8'hcc,8'hcc,8'h78,8'h00, //56
|
||||||
|
8'h78,8'hcc,8'hcc,8'h7c,8'h0c,8'h18,8'h70,8'h00, //57
|
||||||
|
8'h00,8'h00,8'h30,8'h30,8'h00,8'h30,8'h30,8'h00, //58
|
||||||
|
8'h00,8'h00,8'h30,8'h30,8'h00,8'h70,8'h30,8'h60, //59
|
||||||
|
8'h18,8'h30,8'h60,8'hc0,8'h60,8'h30,8'h18,8'h00, //60
|
||||||
|
8'h00,8'h00,8'hfc,8'h00,8'hfc,8'h00,8'h00,8'h00, //61
|
||||||
|
8'h60,8'h30,8'h18,8'h0c,8'h18,8'h30,8'h60,8'h00, //62
|
||||||
|
8'h78,8'hcc,8'h0c,8'h18,8'h30,8'h00,8'h30,8'h00, //63
|
||||||
|
8'h7c,8'hc6,8'hde,8'hde,8'hde,8'hc0,8'h78,8'h00, //64
|
||||||
|
8'h30,8'h78,8'hcc,8'hcc,8'hfc,8'hcc,8'hcc,8'h00, //65
|
||||||
|
8'hfc,8'h66,8'h66,8'h7c,8'h66,8'h66,8'hfc,8'h00, //66
|
||||||
|
8'h3c,8'h66,8'hc0,8'hc0,8'hc0,8'h66,8'h3c,8'h00, //67
|
||||||
|
8'hfc,8'h6c,8'h66,8'h66,8'h66,8'h6c,8'hfc,8'h00, //68
|
||||||
|
8'hfe,8'h62,8'h68,8'h78,8'h68,8'h62,8'hfe,8'h00, //69
|
||||||
|
8'hfe,8'h62,8'h68,8'h78,8'h68,8'h60,8'hf0,8'h00, //70
|
||||||
|
8'h3c,8'h66,8'hc0,8'hc0,8'hce,8'h66,8'h3e,8'h00, //71
|
||||||
|
8'hcc,8'hcc,8'hcc,8'hfc,8'hcc,8'hcc,8'hcc,8'h00, //72
|
||||||
|
8'h78,8'h30,8'h30,8'h30,8'h30,8'h30,8'h78,8'h00, //73
|
||||||
|
8'h1e,8'h0c,8'h0c,8'h0c,8'hcc,8'hcc,8'h78,8'h00, //74
|
||||||
|
8'he6,8'h66,8'h6c,8'h78,8'h6c,8'h66,8'he6,8'h00, //75
|
||||||
|
8'hf0,8'h60,8'h60,8'h60,8'h62,8'h66,8'hfe,8'h00, //76
|
||||||
|
8'hc6,8'hee,8'hfe,8'hd6,8'hc6,8'hc6,8'hc6,8'h00, //77
|
||||||
|
8'hc6,8'he6,8'hf6,8'hde,8'hce,8'hc6,8'hc6,8'h00, //78
|
||||||
|
8'h38,8'h6c,8'hc6,8'hc6,8'hc6,8'h6c,8'h38,8'h00, //79
|
||||||
|
8'hfc,8'h66,8'h66,8'h7c,8'h60,8'h60,8'hf0,8'h00, //80
|
||||||
|
8'h78,8'hcc,8'hcc,8'hcc,8'hdc,8'h78,8'h1c,8'h00, //81
|
||||||
|
8'hfc,8'h66,8'h66,8'h7c,8'h78,8'h6c,8'he6,8'h00, //82
|
||||||
|
8'h78,8'hcc,8'he0,8'h38,8'h1c,8'hcc,8'h78,8'h00, //83
|
||||||
|
8'hfc,8'hb4,8'h30,8'h30,8'h30,8'h30,8'h78,8'h00, //84
|
||||||
|
8'hcc,8'hcc,8'hcc,8'hcc,8'hcc,8'hcc,8'hfc,8'h00, //85
|
||||||
|
8'hcc,8'hcc,8'hcc,8'hcc,8'hcc,8'h78,8'h30,8'h00, //86
|
||||||
|
8'hc6,8'hc6,8'hc6,8'hd6,8'hfe,8'hee,8'hc6,8'h00, //87
|
||||||
|
8'hc6,8'hc6,8'h6c,8'h38,8'h6c,8'hc6,8'hc6,8'h00, //88
|
||||||
|
8'hcc,8'hcc,8'hcc,8'h78,8'h30,8'h30,8'h78,8'h00, //89
|
||||||
|
8'hfe,8'hcc,8'h98,8'h30,8'h62,8'hc6,8'hfe,8'h00, //90
|
||||||
|
8'h78,8'h60,8'h60,8'h60,8'h60,8'h60,8'h78,8'h00, //91
|
||||||
|
8'hc0,8'h60,8'h30,8'h18,8'h0c,8'h06,8'h02,8'h00, //92
|
||||||
|
8'h78,8'h18,8'h18,8'h18,8'h18,8'h18,8'h78,8'h00, //93
|
||||||
|
8'h10,8'h38,8'h6c,8'hc6,8'h00,8'h00,8'h00,8'h00, //94
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'hff, //95
|
||||||
|
8'h30,8'h30,8'h18,8'h00,8'h00,8'h00,8'h00,8'h00, //96
|
||||||
|
8'h00,8'h00,8'h78,8'h0c,8'h7c,8'hcc,8'h76,8'h00, //97
|
||||||
|
8'he0,8'h60,8'h7c,8'h66,8'h66,8'h66,8'hbc,8'h00, //98
|
||||||
|
8'h00,8'h00,8'h78,8'hcc,8'hc0,8'hcc,8'h78,8'h00, //99
|
||||||
|
8'h1c,8'h0c,8'h0c,8'h7c,8'hcc,8'hcc,8'h76,8'h00, //100
|
||||||
|
8'h00,8'h00,8'h78,8'hcc,8'hfc,8'hc0,8'h78,8'h00, //101
|
||||||
|
8'h38,8'h6c,8'h60,8'hf0,8'h60,8'h60,8'hf0,8'h00, //102
|
||||||
|
8'h00,8'h00,8'h76,8'hcc,8'hcc,8'h7c,8'h0c,8'hf8, //103
|
||||||
|
8'he0,8'h60,8'h6c,8'h76,8'h66,8'h66,8'he6,8'h00, //104
|
||||||
|
8'h30,8'h00,8'h70,8'h30,8'h30,8'h30,8'h78,8'h00, //105
|
||||||
|
8'h18,8'h00,8'h78,8'h18,8'h18,8'h18,8'hd8,8'h70, //106
|
||||||
|
8'he0,8'h60,8'h66,8'h6c,8'h78,8'h6c,8'he6,8'h00, //107
|
||||||
|
8'h70,8'h30,8'h30,8'h30,8'h30,8'h30,8'h78,8'h00, //108
|
||||||
|
8'h00,8'h00,8'hec,8'hfe,8'hd6,8'hc6,8'hc6,8'h00, //109
|
||||||
|
8'h00,8'h00,8'hf8,8'hcc,8'hcc,8'hcc,8'hcc,8'h00, //110
|
||||||
|
8'h00,8'h00,8'h78,8'hcc,8'hcc,8'hcc,8'h78,8'h00, //111
|
||||||
|
8'h00,8'h00,8'hdc,8'h66,8'h66,8'h7c,8'h60,8'hf0, //112
|
||||||
|
8'h00,8'h00,8'h76,8'hcc,8'hcc,8'h7c,8'h0c,8'h1e, //113
|
||||||
|
8'h00,8'h00,8'hd8,8'h6c,8'h6c,8'h60,8'hf0,8'h00, //114
|
||||||
|
8'h00,8'h00,8'h7c,8'hc0,8'h78,8'h0c,8'hf8,8'h00, //115
|
||||||
|
8'h10,8'h30,8'h7c,8'h30,8'h30,8'h34,8'h18,8'h00, //116
|
||||||
|
8'h00,8'h00,8'hcc,8'hcc,8'hcc,8'hcc,8'h76,8'h00, //117
|
||||||
|
8'h00,8'h00,8'hcc,8'hcc,8'hcc,8'h78,8'h30,8'h00, //118
|
||||||
|
8'h00,8'h00,8'hc6,8'hc6,8'hd6,8'hfe,8'h6c,8'h00, //119
|
||||||
|
8'h00,8'h00,8'hc6,8'h6c,8'h38,8'h6c,8'hc6,8'h00, //120
|
||||||
|
8'h00,8'h00,8'hcc,8'hcc,8'hcc,8'h7c,8'h0c,8'hf8, //121
|
||||||
|
8'h00,8'h00,8'hfc,8'h98,8'h30,8'h64,8'hfc,8'h00, //122
|
||||||
|
8'h1c,8'h30,8'h30,8'he0,8'h30,8'h30,8'h1c,8'h00, //123
|
||||||
|
8'h18,8'h18,8'h18,8'h00,8'h18,8'h18,8'h18,8'h00, //124
|
||||||
|
8'he0,8'h30,8'h30,8'h1c,8'h30,8'h30,8'he0,8'h00, //125
|
||||||
|
8'h76,8'hdc,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00, //126
|
||||||
|
8'h10,8'h38,8'h6c,8'hc6,8'hc6,8'hc6,8'hfe,8'h00, //127
|
||||||
|
8'h78,8'hcc,8'hc0,8'hcc,8'h78,8'h18,8'h0c,8'h78, //128
|
||||||
|
8'h00,8'hcc,8'h00,8'hcc,8'hcc,8'hcc,8'h7e,8'h00, //129
|
||||||
|
8'h1c,8'h00,8'h78,8'hcc,8'hfc,8'hc0,8'h78,8'h00, //130
|
||||||
|
8'h7e,8'hc3,8'h3c,8'h06,8'h3e,8'h66,8'h3f,8'h00, //131
|
||||||
|
8'hcc,8'h00,8'h78,8'h0c,8'h7c,8'hcc,8'h7e,8'h00, //132
|
||||||
|
8'he0,8'h00,8'h78,8'h0c,8'h7c,8'hcc,8'h7e,8'h00, //133
|
||||||
|
8'h30,8'h30,8'h78,8'h0c,8'h7c,8'hcc,8'h7e,8'h00, //134
|
||||||
|
8'h00,8'h00,8'h7c,8'hc0,8'hc0,8'h7c,8'h06,8'h3c, //135
|
||||||
|
8'h7e,8'hc3,8'h3c,8'h66,8'h7e,8'h60,8'h3c,8'h00, //136
|
||||||
|
8'hcc,8'h00,8'h78,8'hcc,8'hfc,8'hc0,8'h78,8'h00, //137
|
||||||
|
8'he0,8'h00,8'h78,8'hcc,8'hfc,8'hc0,8'h78,8'h00, //138
|
||||||
|
8'hcc,8'h00,8'h70,8'h30,8'h30,8'h30,8'h78,8'h00, //139
|
||||||
|
8'h7c,8'hc6,8'h38,8'h18,8'h18,8'h18,8'h3c,8'h00, //140
|
||||||
|
8'he0,8'h00,8'h70,8'h30,8'h30,8'h30,8'h78,8'h00, //141
|
||||||
|
8'hcc,8'h30,8'h78,8'hcc,8'hcc,8'hfc,8'hcc,8'h00, //142
|
||||||
|
8'h30,8'h30,8'h00,8'h78,8'hcc,8'hfc,8'hcc,8'h00, //143
|
||||||
|
8'h1c,8'h00,8'hfc,8'h60,8'h78,8'h60,8'hfc,8'h00, //144
|
||||||
|
8'h00,8'h00,8'h7f,8'h0c,8'h7f,8'hcc,8'h7f,8'h00, //145
|
||||||
|
8'h3e,8'h6c,8'hcc,8'hfe,8'hcc,8'hcc,8'hce,8'h00, //146
|
||||||
|
8'h78,8'hcc,8'h00,8'h78,8'hcc,8'hcc,8'h78,8'h00, //147
|
||||||
|
8'h00,8'hcc,8'h00,8'h78,8'hcc,8'hcc,8'h78,8'h00, //148
|
||||||
|
8'h00,8'he0,8'h00,8'h78,8'hcc,8'hcc,8'h78,8'h00, //149
|
||||||
|
8'h78,8'hcc,8'h00,8'hcc,8'hcc,8'hcc,8'h7e,8'h00, //150
|
||||||
|
8'h00,8'he0,8'h00,8'hcc,8'hcc,8'hcc,8'h7e,8'h00, //151
|
||||||
|
8'h00,8'hcc,8'h00,8'hcc,8'hcc,8'hfc,8'h0c,8'hf8, //152
|
||||||
|
8'hc6,8'h38,8'h7c,8'hc6,8'hc6,8'h7c,8'h38,8'h00, //153
|
||||||
|
8'hcc,8'h00,8'hcc,8'hcc,8'hcc,8'hcc,8'h78,8'h00, //154
|
||||||
|
8'h18,8'h18,8'h7e,8'hc0,8'hc0,8'h7e,8'h18,8'h18, //155
|
||||||
|
8'h38,8'h6c,8'h64,8'hf0,8'h60,8'he6,8'hfc,8'h00, //156
|
||||||
|
8'hcc,8'hcc,8'h78,8'hfc,8'h30,8'hfc,8'h30,8'h00, //157
|
||||||
|
8'hf0,8'hd8,8'hd8,8'hf4,8'hcc,8'hde,8'hcc,8'h0e, //158
|
||||||
|
8'h0e,8'h1b,8'h18,8'h7e,8'h18,8'h18,8'hd8,8'h70, //159
|
||||||
|
8'h1c,8'h00,8'h78,8'h0c,8'h7c,8'hcc,8'h7e,8'h00, //160
|
||||||
|
8'h38,8'h00,8'h70,8'h30,8'h30,8'h30,8'h78,8'h00, //161
|
||||||
|
8'h00,8'h1c,8'h00,8'h78,8'hcc,8'hcc,8'h78,8'h00, //162
|
||||||
|
8'h00,8'h1c,8'h00,8'hcc,8'hcc,8'hcc,8'h7e,8'h00, //163
|
||||||
|
8'h00,8'hf8,8'h00,8'hf8,8'hcc,8'hcc,8'hcc,8'h00, //164
|
||||||
|
8'hfc,8'h00,8'hcc,8'hec,8'hfc,8'hdc,8'hcc,8'h00, //165
|
||||||
|
8'h3c,8'h6c,8'h6c,8'h3e,8'h00,8'h7e,8'h00,8'h00, //166
|
||||||
|
8'h3c,8'h66,8'h66,8'h3c,8'h00,8'h7e,8'h00,8'h00, //167
|
||||||
|
8'h30,8'h00,8'h30,8'h60,8'hc0,8'hcc,8'h78,8'h00, //168
|
||||||
|
8'h00,8'h00,8'h00,8'hfc,8'hc0,8'hc0,8'h00,8'h00, //169
|
||||||
|
8'h00,8'h00,8'h00,8'hfc,8'h0c,8'h0c,8'h00,8'h00, //170
|
||||||
|
8'hc6,8'hcc,8'hd8,8'h3e,8'h63,8'hce,8'h98,8'h1f, //171
|
||||||
|
8'hc6,8'hcc,8'hd8,8'hf3,8'h67,8'hcf,8'h9f,8'h03, //172
|
||||||
|
8'h00,8'h18,8'h00,8'h18,8'h18,8'h3c,8'h3c,8'h18, //173
|
||||||
|
8'h00,8'h33,8'h66,8'hcc,8'h66,8'h33,8'h00,8'h00, //174
|
||||||
|
8'h00,8'hcc,8'h66,8'h33,8'h66,8'hcc,8'h00,8'h00, //175
|
||||||
|
8'h22,8'h88,8'h22,8'h88,8'h22,8'h88,8'h22,8'h88, //176
|
||||||
|
8'h55,8'haa,8'h55,8'haa,8'h55,8'haa,8'h55,8'haa, //177
|
||||||
|
8'hdd,8'h77,8'hdd,8'h77,8'hdd,8'h77,8'hdd,8'h77, //178
|
||||||
|
8'h18,8'h18,8'h18,8'h18,8'h18,8'h18,8'h18,8'h18, //179
|
||||||
|
8'h18,8'h18,8'h18,8'h18,8'hf8,8'h18,8'h18,8'h18, //180
|
||||||
|
8'h18,8'h18,8'hf8,8'h18,8'hf8,8'h18,8'h18,8'h18, //181
|
||||||
|
8'h36,8'h36,8'h36,8'h36,8'hf6,8'h36,8'h36,8'h36, //182
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'hfe,8'h36,8'h36,8'h36, //183
|
||||||
|
8'h00,8'h00,8'hf8,8'h18,8'hf8,8'h18,8'h18,8'h18, //184
|
||||||
|
8'h36,8'h36,8'hf6,8'h06,8'hf6,8'h36,8'h36,8'h36, //185
|
||||||
|
8'h36,8'h36,8'h36,8'h36,8'h36,8'h36,8'h36,8'h36, //186
|
||||||
|
8'h00,8'h00,8'hfe,8'h06,8'hf6,8'h36,8'h36,8'h36, //187
|
||||||
|
8'h36,8'h36,8'hf6,8'h06,8'hfe,8'h00,8'h00,8'h00, //188
|
||||||
|
8'h36,8'h36,8'h36,8'h36,8'hfe,8'h00,8'h00,8'h00, //189
|
||||||
|
8'h18,8'h18,8'hf8,8'h18,8'hf8,8'h00,8'h00,8'h00, //190
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'hf8,8'h18,8'h18,8'h18, //191
|
||||||
|
8'h18,8'h18,8'h18,8'h18,8'h1f,8'h00,8'h00,8'h00, //192
|
||||||
|
8'h18,8'h18,8'h18,8'h18,8'hff,8'h00,8'h00,8'h00, //193
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'hff,8'h18,8'h18,8'h18, //194
|
||||||
|
8'h18,8'h18,8'h18,8'h18,8'h1f,8'h18,8'h18,8'h18, //195
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'hff,8'h00,8'h00,8'h00, //196
|
||||||
|
8'h18,8'h18,8'h18,8'h18,8'hff,8'h18,8'h18,8'h18, //197
|
||||||
|
8'h18,8'h18,8'h1f,8'h18,8'h1f,8'h18,8'h18,8'h18, //198
|
||||||
|
8'h36,8'h36,8'h36,8'h36,8'h37,8'h36,8'h36,8'h36, //199
|
||||||
|
8'h36,8'h36,8'h37,8'h30,8'h3f,8'h00,8'h00,8'h00, //200
|
||||||
|
8'h00,8'h00,8'h3f,8'h30,8'h37,8'h36,8'h36,8'h36, //201
|
||||||
|
8'h36,8'h36,8'hf7,8'h00,8'hff,8'h00,8'h00,8'h00, //202
|
||||||
|
8'h00,8'h00,8'hff,8'h00,8'hf7,8'h36,8'h36,8'h36, //203
|
||||||
|
8'h36,8'h36,8'h37,8'h30,8'h37,8'h36,8'h36,8'h36, //204
|
||||||
|
8'h00,8'h00,8'hff,8'h00,8'hff,8'h00,8'h00,8'h00, //205
|
||||||
|
8'h36,8'h36,8'hf7,8'h00,8'hf7,8'h36,8'h36,8'h36, //206
|
||||||
|
8'h18,8'h18,8'hff,8'h00,8'hff,8'h00,8'h00,8'h00, //207
|
||||||
|
8'h36,8'h36,8'h36,8'h36,8'hff,8'h00,8'h00,8'h00, //208
|
||||||
|
8'h00,8'h00,8'hff,8'h00,8'hff,8'h18,8'h18,8'h18, //209
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'hff,8'h36,8'h36,8'h36, //210
|
||||||
|
8'h36,8'h36,8'h36,8'h36,8'h3f,8'h00,8'h00,8'h00, //211
|
||||||
|
8'h18,8'h18,8'h1f,8'h18,8'h1f,8'h00,8'h00,8'h00, //212
|
||||||
|
8'h00,8'h00,8'h1f,8'h18,8'h1f,8'h18,8'h18,8'h18, //213
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'h3f,8'h36,8'h36,8'h36, //214
|
||||||
|
8'h36,8'h36,8'h36,8'h36,8'hf7,8'h36,8'h36,8'h36, //215
|
||||||
|
8'h18,8'h18,8'hff,8'h00,8'hff,8'h18,8'h18,8'h18, //216
|
||||||
|
8'h18,8'h18,8'h18,8'h18,8'hf8,8'h00,8'h00,8'h00, //217
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'h1f,8'h18,8'h18,8'h18, //218
|
||||||
|
8'hff,8'hff,8'hff,8'hff,8'hff,8'hff,8'hff,8'hff, //219
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'hff,8'hff,8'hff,8'hff, //220
|
||||||
|
8'hf0,8'hf0,8'hf0,8'hf0,8'hf0,8'hf0,8'hf0,8'hf0, //221
|
||||||
|
8'h0f,8'h0f,8'h0f,8'h0f,8'h0f,8'h0f,8'h0f,8'h0f, //222
|
||||||
|
8'hff,8'hff,8'hff,8'hff,8'h00,8'h00,8'h00,8'h00, //223
|
||||||
|
8'h00,8'h00,8'h76,8'hdc,8'hc8,8'hdc,8'h76,8'h00, //224
|
||||||
|
8'h00,8'h78,8'hcc,8'hf8,8'hcc,8'hf8,8'hc0,8'hc0, //225
|
||||||
|
8'h00,8'hfe,8'hc6,8'hc0,8'hc0,8'hc0,8'hc0,8'h00, //226
|
||||||
|
8'h00,8'hfe,8'h6c,8'h6c,8'h6c,8'h6c,8'h6c,8'h00, //227
|
||||||
|
8'hfe,8'h66,8'h30,8'h18,8'h30,8'h66,8'hfe,8'h00, //228
|
||||||
|
8'h00,8'h00,8'h7e,8'hcc,8'hcc,8'hcc,8'h78,8'h00, //229
|
||||||
|
8'h00,8'h66,8'h66,8'h66,8'h66,8'h7c,8'h60,8'hc0, //230
|
||||||
|
8'h00,8'h76,8'hdc,8'h18,8'h18,8'h18,8'h18,8'h00, //231
|
||||||
|
8'hfc,8'h30,8'h78,8'hcc,8'hcc,8'h78,8'h30,8'hfc, //232
|
||||||
|
8'h38,8'h6c,8'hc6,8'hfe,8'hc6,8'h6c,8'h38,8'h00, //233
|
||||||
|
8'h38,8'h6c,8'hc6,8'hc6,8'h6c,8'h6c,8'hee,8'h00, //234
|
||||||
|
8'h1c,8'h30,8'h18,8'h7c,8'hcc,8'hcc,8'h78,8'h00, //235
|
||||||
|
8'h00,8'h00,8'h7e,8'hdb,8'hdb,8'h7e,8'h00,8'h00, //236
|
||||||
|
8'h06,8'h0c,8'h7e,8'hdb,8'hdb,8'h7e,8'h60,8'hc0, //237
|
||||||
|
8'h3c,8'h60,8'hc0,8'hfc,8'hc0,8'h60,8'h3c,8'h00, //238
|
||||||
|
8'h78,8'hcc,8'hcc,8'hcc,8'hcc,8'hcc,8'hcc,8'h00, //239
|
||||||
|
8'h00,8'hfc,8'h00,8'hfc,8'h00,8'hfc,8'h00,8'h00, //240
|
||||||
|
8'h30,8'h30,8'hfc,8'h30,8'h30,8'h00,8'hfc,8'h00, //241
|
||||||
|
8'h60,8'h30,8'h18,8'h30,8'h60,8'h00,8'hfc,8'h00, //242
|
||||||
|
8'h18,8'h30,8'h60,8'h30,8'h18,8'h00,8'hfc,8'h00, //243
|
||||||
|
8'h0e,8'h1b,8'h1b,8'h18,8'h18,8'h18,8'h18,8'h18, //244
|
||||||
|
8'h18,8'h18,8'h18,8'h18,8'h18,8'hd8,8'hd8,8'h70, //245
|
||||||
|
8'h30,8'h30,8'h00,8'hfc,8'h00,8'h30,8'h30,8'h00, //246
|
||||||
|
8'h00,8'h72,8'h9c,8'h00,8'h72,8'h9c,8'h00,8'h00, //247
|
||||||
|
8'h38,8'h6c,8'h6c,8'h38,8'h00,8'h00,8'h00,8'h00, //248
|
||||||
|
8'h00,8'h00,8'h00,8'h18,8'h18,8'h00,8'h00,8'h00, //249
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'h18,8'h00,8'h00,8'h00, //250
|
||||||
|
8'h0f,8'h0c,8'h0c,8'h0c,8'hec,8'h6c,8'h3c,8'h1c, //251
|
||||||
|
8'h78,8'h6c,8'h6c,8'h6c,8'h6c,8'h00,8'h00,8'h00, //252
|
||||||
|
8'h78,8'h0c,8'h38,8'h60,8'h7c,8'h00,8'h00,8'h00, //253
|
||||||
|
8'h00,8'h00,8'h3c,8'h3c,8'h3c,8'h3c,8'h00,8'h00, //254
|
||||||
|
8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00,8'h00 //255
|
||||||
|
};
|
||||||
|
end
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
`endif
|
69
hvsync_generator.v
Normal file
69
hvsync_generator.v
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
|
||||||
|
`ifndef HVSYNC_GENERATOR_H
|
||||||
|
`define HVSYNC_GENERATOR_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
Video sync generator, used to drive a simulated CRT.
|
||||||
|
To use:
|
||||||
|
- Wire the hsync and vsync signals to top level outputs
|
||||||
|
- Add a 3-bit (or more) "rgb" output to the top level
|
||||||
|
*/
|
||||||
|
|
||||||
|
module hvsync_generator(clk, reset, hsync, vsync, display_on, hpos, vpos);
|
||||||
|
|
||||||
|
input clk;
|
||||||
|
input reset;
|
||||||
|
output reg hsync, vsync;
|
||||||
|
output display_on;
|
||||||
|
output reg [8:0] hpos;
|
||||||
|
output reg [8:0] vpos;
|
||||||
|
|
||||||
|
// declarations for TV-simulator sync parameters
|
||||||
|
// horizontal constants
|
||||||
|
parameter H_DISPLAY = 256; // horizontal display width
|
||||||
|
parameter H_BACK = 23; // horizontal left border (back porch)
|
||||||
|
parameter H_FRONT = 7; // horizontal right border (front porch)
|
||||||
|
parameter H_SYNC = 23; // horizontal sync width
|
||||||
|
// vertical constants
|
||||||
|
parameter V_DISPLAY = 240; // vertical display height
|
||||||
|
parameter V_TOP = 5; // vertical top border
|
||||||
|
parameter V_BOTTOM = 14; // vertical bottom border
|
||||||
|
parameter V_SYNC = 3; // vertical sync # lines
|
||||||
|
// derived constants
|
||||||
|
parameter H_SYNC_START = H_DISPLAY + H_FRONT;
|
||||||
|
parameter H_SYNC_END = H_DISPLAY + H_FRONT + H_SYNC - 1;
|
||||||
|
parameter H_MAX = H_DISPLAY + H_BACK + H_FRONT + H_SYNC - 1;
|
||||||
|
parameter V_SYNC_START = V_DISPLAY + V_BOTTOM;
|
||||||
|
parameter V_SYNC_END = V_DISPLAY + V_BOTTOM + V_SYNC - 1;
|
||||||
|
parameter V_MAX = V_DISPLAY + V_TOP + V_BOTTOM + V_SYNC - 1;
|
||||||
|
|
||||||
|
wire hmaxxed = (hpos == H_MAX) || reset; // set when hpos is maximum
|
||||||
|
wire vmaxxed = (vpos == V_MAX) || reset; // set when vpos is maximum
|
||||||
|
|
||||||
|
// horizontal position counter
|
||||||
|
always @(posedge clk)
|
||||||
|
begin
|
||||||
|
hsync <= (hpos>=H_SYNC_START && hpos<=H_SYNC_END);
|
||||||
|
if(hmaxxed)
|
||||||
|
hpos <= 0;
|
||||||
|
else
|
||||||
|
hpos <= hpos + 1;
|
||||||
|
end
|
||||||
|
|
||||||
|
// vertical position counter
|
||||||
|
always @(posedge clk)
|
||||||
|
begin
|
||||||
|
vsync <= (vpos>=V_SYNC_START && vpos<=V_SYNC_END);
|
||||||
|
if(hmaxxed)
|
||||||
|
if (vmaxxed)
|
||||||
|
vpos <= 0;
|
||||||
|
else
|
||||||
|
vpos <= vpos + 1;
|
||||||
|
end
|
||||||
|
|
||||||
|
// display_on is set when beam is in "safe" visible frame
|
||||||
|
assign display_on = (hpos<H_DISPLAY) && (vpos<V_DISPLAY);
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
`endif
|
256
mango1.hex
Normal file
256
mango1.hex
Normal file
@ -0,0 +1,256 @@
|
|||||||
|
78
|
||||||
|
d8
|
||||||
|
a2
|
||||||
|
ff
|
||||||
|
9a
|
||||||
|
20
|
||||||
|
0b
|
||||||
|
ff
|
||||||
|
4c
|
||||||
|
05
|
||||||
|
ff
|
||||||
|
20
|
||||||
|
b5
|
||||||
|
ff
|
||||||
|
a9
|
||||||
|
23
|
||||||
|
20
|
||||||
|
c4
|
||||||
|
ff
|
||||||
|
20
|
||||||
|
ba
|
||||||
|
ff
|
||||||
|
c9
|
||||||
|
52
|
||||||
|
f0
|
||||||
|
17
|
||||||
|
c9
|
||||||
|
57
|
||||||
|
f0
|
||||||
|
34
|
||||||
|
c9
|
||||||
|
47
|
||||||
|
f0
|
||||||
|
40
|
||||||
|
c9
|
||||||
|
0d
|
||||||
|
f0
|
||||||
|
0e
|
||||||
|
20
|
||||||
|
b5
|
||||||
|
ff
|
||||||
|
a9
|
||||||
|
3f
|
||||||
|
20
|
||||||
|
c4
|
||||||
|
ff
|
||||||
|
4c
|
||||||
|
00
|
||||||
|
ff
|
||||||
|
20
|
||||||
|
68
|
||||||
|
ff
|
||||||
|
20
|
||||||
|
cd
|
||||||
|
ff
|
||||||
|
a9
|
||||||
|
3a
|
||||||
|
20
|
||||||
|
c4
|
||||||
|
ff
|
||||||
|
a9
|
||||||
|
20
|
||||||
|
20
|
||||||
|
c4
|
||||||
|
ff
|
||||||
|
a0
|
||||||
|
00
|
||||||
|
b1
|
||||||
|
2c
|
||||||
|
20
|
||||||
|
d4
|
||||||
|
ff
|
||||||
|
20
|
||||||
|
ea
|
||||||
|
ff
|
||||||
|
a5
|
||||||
|
2c
|
||||||
|
29
|
||||||
|
07
|
||||||
|
d0
|
||||||
|
eb
|
||||||
|
60
|
||||||
|
20
|
||||||
|
68
|
||||||
|
ff
|
||||||
|
a9
|
||||||
|
3a
|
||||||
|
20
|
||||||
|
c4
|
||||||
|
ff
|
||||||
|
20
|
||||||
|
8b
|
||||||
|
ff
|
||||||
|
a0
|
||||||
|
00
|
||||||
|
91
|
||||||
|
2c
|
||||||
|
60
|
||||||
|
20
|
||||||
|
68
|
||||||
|
ff
|
||||||
|
6c
|
||||||
|
2c
|
||||||
|
00
|
||||||
|
a9
|
||||||
|
00
|
||||||
|
85
|
||||||
|
2c
|
||||||
|
85
|
||||||
|
2d
|
||||||
|
20
|
||||||
|
9f
|
||||||
|
ff
|
||||||
|
b0
|
||||||
|
40
|
||||||
|
f0
|
||||||
|
f3
|
||||||
|
0a
|
||||||
|
0a
|
||||||
|
0a
|
||||||
|
0a
|
||||||
|
a0
|
||||||
|
04
|
||||||
|
0a
|
||||||
|
26
|
||||||
|
2c
|
||||||
|
26
|
||||||
|
2d
|
||||||
|
88
|
||||||
|
d0
|
||||||
|
f8
|
||||||
|
20
|
||||||
|
9f
|
||||||
|
ff
|
||||||
|
b0
|
||||||
|
2b
|
||||||
|
4c
|
||||||
|
75
|
||||||
|
ff
|
||||||
|
20
|
||||||
|
9f
|
||||||
|
ff
|
||||||
|
b0
|
||||||
|
23
|
||||||
|
0a
|
||||||
|
0a
|
||||||
|
0a
|
||||||
|
0a
|
||||||
|
85
|
||||||
|
2a
|
||||||
|
20
|
||||||
|
9f
|
||||||
|
ff
|
||||||
|
b0
|
||||||
|
18
|
||||||
|
05
|
||||||
|
2a
|
||||||
|
18
|
||||||
|
60
|
||||||
|
20
|
||||||
|
ba
|
||||||
|
ff
|
||||||
|
38
|
||||||
|
e9
|
||||||
|
30
|
||||||
|
c9
|
||||||
|
0a
|
||||||
|
90
|
||||||
|
0b
|
||||||
|
e9
|
||||||
|
11
|
||||||
|
c9
|
||||||
|
06
|
||||||
|
b0
|
||||||
|
04
|
||||||
|
18
|
||||||
|
69
|
||||||
|
0a
|
||||||
|
60
|
||||||
|
38
|
||||||
|
60
|
||||||
|
a9
|
||||||
|
0d
|
||||||
|
4c
|
||||||
|
c4
|
||||||
|
ff
|
||||||
|
ad
|
||||||
|
10
|
||||||
|
d0
|
||||||
|
10
|
||||||
|
fb
|
||||||
|
8d
|
||||||
|
11
|
||||||
|
d0
|
||||||
|
29
|
||||||
|
7f
|
||||||
|
2c
|
||||||
|
12
|
||||||
|
d0
|
||||||
|
30
|
||||||
|
fb
|
||||||
|
8d
|
||||||
|
12
|
||||||
|
d0
|
||||||
|
60
|
||||||
|
a5
|
||||||
|
2d
|
||||||
|
20
|
||||||
|
d4
|
||||||
|
ff
|
||||||
|
a5
|
||||||
|
2c
|
||||||
|
48
|
||||||
|
4a
|
||||||
|
4a
|
||||||
|
4a
|
||||||
|
4a
|
||||||
|
20
|
||||||
|
dd
|
||||||
|
ff
|
||||||
|
68
|
||||||
|
29
|
||||||
|
0f
|
||||||
|
18
|
||||||
|
69
|
||||||
|
30
|
||||||
|
c9
|
||||||
|
3a
|
||||||
|
90
|
||||||
|
de
|
||||||
|
69
|
||||||
|
06
|
||||||
|
90
|
||||||
|
da
|
||||||
|
e6
|
||||||
|
2c
|
||||||
|
d0
|
||||||
|
c6
|
||||||
|
e6
|
||||||
|
2d
|
||||||
|
60
|
||||||
|
40
|
||||||
|
ff
|
||||||
|
ff
|
||||||
|
ff
|
||||||
|
ff
|
||||||
|
ff
|
||||||
|
ff
|
||||||
|
ff
|
||||||
|
ff
|
||||||
|
f1
|
||||||
|
ff
|
||||||
|
00
|
||||||
|
ff
|
||||||
|
f1
|
||||||
|
ff
|
154
mango1.v
Normal file
154
mango1.v
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
|
||||||
|
`include "hvsync_generator.v"
|
||||||
|
`include "cpu6502.v"
|
||||||
|
`include "font_cp437_8x8.v"
|
||||||
|
|
||||||
|
// https://www.applefritter.com/replica/chapter7
|
||||||
|
// https://github.com/mamedev/mame/blob/master/src/mame/drivers/apple1.cpp
|
||||||
|
// https://github.com/jefftranter/6502/blob/master/asm/wozmon/wozmon.s
|
||||||
|
// https://www.applefritter.com/files/signetics2513.pdf
|
||||||
|
// http://retro.hansotten.nl/uploads/6502docs/signetics2504.pdf
|
||||||
|
// http://retro.hansotten.nl/uploads/6502docs/signetics2519.pdf
|
||||||
|
|
||||||
|
module signetics_term(clk, reset, hpos, vpos, tready, dot, te, ti);
|
||||||
|
|
||||||
|
input clk,reset;
|
||||||
|
input [8:0] hpos;
|
||||||
|
input [8:0] vpos;
|
||||||
|
input te; // input enable
|
||||||
|
input [7:0] ti; // input data
|
||||||
|
output tready; // terminal ready
|
||||||
|
output dot; // terminal video output
|
||||||
|
|
||||||
|
reg [7:0] dshift[1024]; // frame buffer offset
|
||||||
|
reg [9:0] dofs; // current offset to write
|
||||||
|
reg [9:0] scroll; // scroll offset
|
||||||
|
reg [9:0] scnt; // row clear counter when scrolling
|
||||||
|
|
||||||
|
always @(posedge clk or posedge reset)
|
||||||
|
if (reset) begin
|
||||||
|
scnt <= 0;
|
||||||
|
scroll <= 0;
|
||||||
|
dofs <= 28*32;
|
||||||
|
scroll <= 0;
|
||||||
|
end else if (scnt > 0) begin
|
||||||
|
dshift[scroll] <= 0; // clear row when scrolling
|
||||||
|
scroll <= scroll + 1;
|
||||||
|
scnt <= scnt - 1;
|
||||||
|
end else if (te) begin
|
||||||
|
if (ti == 13) begin // CR, next row
|
||||||
|
scnt <= 32;
|
||||||
|
dofs <= ((dofs + 32) & ~31);
|
||||||
|
end else if (ti >= 32) begin // display char
|
||||||
|
dshift[dofs] <= ti;
|
||||||
|
if ((dofs & 31) == 31) scnt <= 32; // wrap around
|
||||||
|
dofs <= dofs + 1;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
// character generator from ROM
|
||||||
|
font_cp437_8x8 tile_rom(
|
||||||
|
.addr(char_addr),
|
||||||
|
.data(char_data)
|
||||||
|
);
|
||||||
|
wire [9:0] nt_addr = {vpos[7:3], hpos[7:3]};
|
||||||
|
wire [7:0] cur_char = dshift[nt_addr + scroll];
|
||||||
|
wire [10:0] char_addr = {cur_char, vpos[2:0]};
|
||||||
|
wire [7:0] char_data;
|
||||||
|
wire dot = char_data[~hpos[2:0]]; // video output
|
||||||
|
|
||||||
|
// terminal ready output
|
||||||
|
// only possible at end of line, if not scrolling
|
||||||
|
assign tready = !reset && !te && scnt == 0 && hpos == 256;
|
||||||
|
|
||||||
|
initial begin
|
||||||
|
integer i;
|
||||||
|
for (i=0; i<1024; i=i+1) dshift[i] = 0; // clear buffer
|
||||||
|
end
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
module apple1_top(clk, reset, hsync, vsync, rgb, keycode, keystrobe);
|
||||||
|
|
||||||
|
input clk, reset;
|
||||||
|
input [7:0] keycode;
|
||||||
|
output reg keystrobe;
|
||||||
|
output hsync, vsync;
|
||||||
|
output [2:0] rgb;
|
||||||
|
wire display_on;
|
||||||
|
wire [8:0] hpos;
|
||||||
|
wire [8:0] vpos;
|
||||||
|
|
||||||
|
wire [15:0] AB; // address bus
|
||||||
|
wire [7:0] DI; // data in, read bus
|
||||||
|
wire [7:0] DO; // data out, write bus
|
||||||
|
wire WE; // write enable
|
||||||
|
wire IRQ=0; // interrupt request
|
||||||
|
wire NMI=0; // non-maskable interrupt request
|
||||||
|
wire RDY=1; // Ready signal. Pauses CPU when RDY=0
|
||||||
|
|
||||||
|
cpu6502 cpu( clk, reset, AB, DI, DO, WE, IRQ, NMI, RDY );
|
||||||
|
|
||||||
|
always @(posedge clk)
|
||||||
|
begin
|
||||||
|
casez (AB)
|
||||||
|
16'h0zzz: DI <= ram[AB[11:0]];
|
||||||
|
16'hd010: begin
|
||||||
|
if (keycode >= 97+128 && keycode <= 122+128)
|
||||||
|
DI <= keycode - 32; // convert to uppercase
|
||||||
|
else
|
||||||
|
DI <= keycode; // keyboard data
|
||||||
|
keystrobe <= (keycode & 8'h80) != 0; // clear kbd buffer
|
||||||
|
end
|
||||||
|
16'hd011: begin
|
||||||
|
DI <= keycode & 8'h80; // keyboard status
|
||||||
|
keystrobe <= 0;
|
||||||
|
end
|
||||||
|
16'hd012: begin
|
||||||
|
DI <= {!tready, 7'b0}; // display status
|
||||||
|
end
|
||||||
|
16'hffzz: DI <= monitor_rom[AB[7:0]];
|
||||||
|
endcase
|
||||||
|
end
|
||||||
|
|
||||||
|
always @(posedge clk)
|
||||||
|
if (WE) begin
|
||||||
|
casez (AB)
|
||||||
|
16'hd010: begin end //
|
||||||
|
16'hd011: begin end //
|
||||||
|
16'hd012: begin end // handled by terminal module
|
||||||
|
16'hd013: begin end //
|
||||||
|
16'h0zzz: ram[AB[11:0]] <= DO; // write RAM
|
||||||
|
endcase
|
||||||
|
end
|
||||||
|
|
||||||
|
reg [7:0] ram[4096]; // 1K of RAM
|
||||||
|
reg [7:0] monitor_rom[256]; // WozMon ROM
|
||||||
|
|
||||||
|
initial begin
|
||||||
|
$readmemh("mango1.hex", monitor_rom);
|
||||||
|
end
|
||||||
|
|
||||||
|
hvsync_generator hvsync_gen(
|
||||||
|
.clk(clk),
|
||||||
|
.reset(reset),
|
||||||
|
.hsync(hsync),
|
||||||
|
.vsync(vsync),
|
||||||
|
.display_on(display_on),
|
||||||
|
.hpos(hpos),
|
||||||
|
.vpos(vpos)
|
||||||
|
);
|
||||||
|
|
||||||
|
wire tready; // terminal ready
|
||||||
|
wire dot; // dot output
|
||||||
|
wire te = WE && AB == 16'hd012; // terminal enable (write)
|
||||||
|
signetics_term terminal(clk, reset, hpos, vpos,
|
||||||
|
tready, dot,
|
||||||
|
te, .ti(DO & 8'h7f));
|
||||||
|
|
||||||
|
wire r = display_on && 0;
|
||||||
|
wire g = display_on && dot;
|
||||||
|
wire b = display_on && 0;
|
||||||
|
assign rgb = {b,g,r};
|
||||||
|
|
||||||
|
endmodule
|
Loading…
x
Reference in New Issue
Block a user