forked from MirrorRepos/RomWBW
44 changed files with 133 additions and 1642 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,338 +0,0 @@ |
|||
5 PRINT "Simple VIDEO test for N8-2511; I/O Base is assumed as 128" |
|||
10 BASE=128 |
|||
20 DATAP=BASE+24 |
|||
30 CMDP=BASE+25 |
|||
40 GOTO 140 |
|||
50 PRINT "Let's set VDP write address to #0000" |
|||
60 OUT CMDP,0 |
|||
70 OUT CMDP,64 :REM 40H |
|||
80 REM NOW LET's clear first 16Kb of VDP memory |
|||
90 PRINT "NOW LET's clear first 16Kb of VDP memory" |
|||
100 FOR A=0 TO 16383 |
|||
110 REM PRINT "ADDR:";HEX$(A);CHR$(13); |
|||
120 OUT DATAP,0 |
|||
130 NEXT A |
|||
140 PRINT "Now it is time to set up VDP registers" |
|||
160 REM Register 0 to #0 |
|||
170 REM Set mode selection bit M3 (maybe also M4 & M5) to zero and |
|||
180 REM disable external video & horizontal interrupt |
|||
190 OUT CMDP,0 |
|||
200 OUT CMDP,128 :REM 80h |
|||
210 REM Register 1 to #50 |
|||
220 PRINT "Select 40 column mode, enable screen and disable vertical interrupt" |
|||
230 OUT CMDP,80 :REM 50h |
|||
240 OUT CMDP,129 :REM 81h |
|||
250 REM Register 2 to #0 |
|||
260 PRINT "Set pattern name table to #0000" |
|||
270 OUT CMDP,0 |
|||
280 OUT CMDP,130 :REM 82H |
|||
290 REM REGISTER 3 IS IGNORED AS 40 COLUMN MODE DOES NOT NEED COLOR TABLE |
|||
300 REM Register 4 to #1 |
|||
310 PRINT "SET PATTERN GENERATOR TABLE TO #800" |
|||
320 OUT CMDP,1 |
|||
330 OUT CMDP,132 :REM 84h |
|||
340 REM Registers 5 (Sprite attribute) & 6 (Sprite pattern) are ignored |
|||
350 REM as 40 column mode does not have sprites |
|||
360 REM Register 7 to #F0 |
|||
370 PRINT "Set colors to white on black" |
|||
380 OUT CMDP,240 :REM F0h |
|||
390 OUT CMDP,135 :REM 87h |
|||
400 REM Let's set VDP write address to #800 so, that we can write |
|||
410 REM character set to memory |
|||
430 OUT CMDP,0 |
|||
440 OUT CMDP,72 :REM 48h |
|||
450 REM Create a character set |
|||
460 PRINT "Create a character set" |
|||
470 FOR C=0 TO 255 |
|||
480 FOR D=0 TO 7 |
|||
500 READ V |
|||
510 OUT DATAP,V |
|||
520 NEXT D |
|||
530 NEXT C |
|||
540 REM Let's set write address to start of name table |
|||
550 PRINT "LET's put characters to screen" |
|||
555 D=0 |
|||
560 OUT CMDP,0 |
|||
570 OUT CMDP,64 :REM 40h |
|||
580 REM LET's put characters to screen |
|||
600 FOR C=0 TO ((40 * 24) - 1) |
|||
610 OUT DATAP,D |
|||
620 D=D+1 |
|||
630 IF D=128 THEN D=0 |
|||
640 NEXT C |
|||
700 BASE=128 |
|||
710 DATAP=BASE+24 |
|||
720 CMDP=BASE+25 |
|||
730 OUT CMDP,0 |
|||
740 OUT CMDP,0 |
|||
750 FOR C=0 TO 16 |
|||
760 V = INP(DATAP) |
|||
770 PRINT HEX$(V) |
|||
780 NEXT C |
|||
790 STOP |
|||
800 BASE=128 |
|||
810 DATAP=BASE+24 |
|||
820 CMDP=BASE+25 |
|||
830 FOR C=0 TO 255 |
|||
840 PRINT HEX$(C) |
|||
850 OUT CMDP,C |
|||
860 OUT CMDP,135 :REM REGISTER 7 |
|||
870 INPUT "<RET> TO CONTINUE",A$ |
|||
880 NEXT C |
|||
890 END |
|||
10000 DATA 0,0,0,0,0,0,0,0 |
|||
10001 DATA 0,0,0,60,60,48,48,48 |
|||
10002 DATA 0,0,0,240,240,48,48,48 |
|||
10003 DATA 48,48,48,60,60,0,0,0 |
|||
10004 DATA 48,48,48,240,240,0,0,0 |
|||
10005 DATA 48,48,48,48,48,48,48,48 |
|||
10006 DATA 0,0,0,255,255,0,0,0 |
|||
10007 DATA 0,32,112,248,112,32,0,0 |
|||
10008 DATA 248,216,136,0,136,216,248,0 |
|||
10009 DATA 0,0,0,0,0,0,0,0 |
|||
10010 DATA 0,0,0,0,0,0,0,0 |
|||
10011 DATA 24,24,32,96,144,96,0,0 |
|||
10012 DATA 32,80,32,32,112,32,0,0 |
|||
10013 DATA 0,0,0,0,0,0,0,0 |
|||
10014 DATA 0,0,0,0,0,0,0,0 |
|||
10015 DATA 168,80,80,216,80,80,168,0 |
|||
10016 DATA 48,48,48,252,252,48,48,48 |
|||
10017 DATA 16,48,112,240,112,48,16,0 |
|||
10018 DATA 32,112,32,32,32,112,32,0 |
|||
10019 DATA 80,80,80,80,0,80,0,0 |
|||
10020 DATA 120,168,168,104,40,40,0,0 |
|||
10021 DATA 48,48,48,252,252,0,0,0 |
|||
10022 DATA 0,0,0,252,252,48,48,48 |
|||
10023 DATA 48,48,48,240,240,48,48,48 |
|||
10024 DATA 32,112,32,32,32,32,32,32 |
|||
10025 DATA 48,48,48,60,60,48,48,48 |
|||
10026 DATA 0,16,24,252,24,16,0,0 |
|||
10027 DATA 0,32,96,252,96,32,0,0 |
|||
10028 DATA 0,0,0,0,0,0,0,0 |
|||
10029 DATA 0,0,0,0,0,0,0,0 |
|||
10030 DATA 0,0,0,0,0,0,0,0 |
|||
10031 DATA 0,0,0,0,0,0,0,0 |
|||
10032 DATA 0,0,0,0,0,0,0,0 |
|||
10033 DATA 48,120,120,48,0,48,0,0 |
|||
10034 DATA 216,216,80,0,0,0,0,0 |
|||
10035 DATA 72,72,252,72,72,252,72,72 |
|||
10036 DATA 32,120,160,120,36,248,32,0 |
|||
10037 DATA 0,200,208,32,88,152,0,0 |
|||
10038 DATA 48,72,72,80,96,144,120,0 |
|||
10039 DATA 48,48,64,0,0,0,0,0 |
|||
10040 DATA 16,32,32,32,32,32,16,0 |
|||
10041 DATA 32,16,16,16,16,16,32,0 |
|||
10042 DATA 32,168,112,248,112,168,32,0 |
|||
10043 DATA 0,32,32,248,32,32,0,0 |
|||
10044 DATA 0,0,0,0,0,48,48,64 |
|||
10045 DATA 0,0,0,252,0,0,0,0 |
|||
10046 DATA 0,0,0,0,0,48,48,0 |
|||
10047 DATA 4,8,16,32,64,128,0,0 |
|||
10048 DATA 112,152,168,168,168,200,112,0 |
|||
10049 DATA 32,96,32,32,32,32,248,0 |
|||
10050 DATA 32,80,16,32,64,128,248,0 |
|||
10051 DATA 112,136,8,112,8,136,112,0 |
|||
10052 DATA 48,80,144,248,16,16,16,0 |
|||
10053 DATA 248,128,128,240,8,136,112,0 |
|||
10054 DATA 56,64,128,240,136,136,112,0 |
|||
10055 DATA 248,8,16,32,32,32,32,0 |
|||
10056 DATA 112,136,136,112,136,136,112,0 |
|||
10057 DATA 112,136,136,120,8,136,112,0 |
|||
10058 DATA 0,48,48,0,48,48,0,0 |
|||
10059 DATA 0,48,48,0,48,48,96,0 |
|||
10060 DATA 16,32,64,128,64,32,16,0 |
|||
10061 DATA 0,0,252,0,252,0,0,0 |
|||
10062 DATA 64,32,16,8,16,32,64,0 |
|||
10063 DATA 112,136,8,48,32,0,32,0 |
|||
10064 DATA 112,136,184,176,128,128,112,0 |
|||
10065 DATA 32,80,136,248,136,136,136,0 |
|||
10066 DATA 240,72,72,112,72,72,240,0 |
|||
10067 DATA 112,136,128,128,128,136,112,0 |
|||
10068 DATA 240,72,72,72,72,72,240,0 |
|||
10069 DATA 248,136,128,224,128,136,248,0 |
|||
10070 DATA 248,136,128,240,128,128,128,0 |
|||
10071 DATA 112,136,128,184,136,136,112,0 |
|||
10072 DATA 136,136,136,248,136,136,136,0 |
|||
10073 DATA 248,32,32,32,32,32,248,0 |
|||
10074 DATA 28,8,8,8,8,136,112,0 |
|||
10075 DATA 136,144,160,192,160,144,136,0 |
|||
10076 DATA 128,128,128,128,128,136,248,0 |
|||
10077 DATA 136,216,168,136,136,136,136,0 |
|||
10078 DATA 136,200,168,168,168,152,136,0 |
|||
10079 DATA 112,136,136,136,136,136,112,0 |
|||
10080 DATA 240,136,136,240,128,128,128,0 |
|||
10081 DATA 112,136,136,136,168,152,120,4 |
|||
10082 DATA 240,136,136,240,160,144,136,0 |
|||
10083 DATA 112,136,64,32,16,136,112,0 |
|||
10084 DATA 248,32,32,32,32,32,112,0 |
|||
10085 DATA 136,136,136,136,136,136,112,0 |
|||
10086 DATA 136,136,136,80,80,80,32,0 |
|||
10087 DATA 136,136,136,168,168,168,80,0 |
|||
10088 DATA 136,136,80,32,80,136,136,0 |
|||
10089 DATA 136,136,80,32,32,32,32,0 |
|||
10090 DATA 248,136,16,32,64,136,248,0 |
|||
10091 DATA 120,64,64,64,64,64,120,0 |
|||
10092 DATA 0,128,64,32,16,8,0,0 |
|||
10093 DATA 120,8,8,8,8,8,120,0 |
|||
10094 DATA 32,80,136,0,0,0,0,0 |
|||
10095 DATA 0,0,0,0,0,0,252,0 |
|||
10096 DATA 96,96,16,0,0,0,0,0 |
|||
10097 DATA 0,0,240,8,120,136,112,0 |
|||
10098 DATA 128,128,128,240,136,136,240,0 |
|||
10099 DATA 0,0,0,112,128,128,112,0 |
|||
10100 DATA 8,8,8,120,136,136,120,0 |
|||
10101 DATA 0,0,112,136,248,128,112,0 |
|||
10102 DATA 0,48,72,224,64,64,64,0 |
|||
10103 DATA 0,0,56,72,72,56,8,112 |
|||
10104 DATA 0,128,128,176,200,136,136,0 |
|||
10105 DATA 0,0,32,0,96,32,112,0 |
|||
10106 DATA 0,8,0,24,8,8,72,48 |
|||
10107 DATA 128,128,144,160,192,160,144,0 |
|||
10108 DATA 32,32,32,32,32,32,32,0 |
|||
10109 DATA 0,0,0,80,168,168,136,0 |
|||
10110 DATA 0,0,0,176,200,136,136,0 |
|||
10111 DATA 0,0,0,112,136,136,112,0 |
|||
10112 DATA 0,0,112,72,72,112,64,64 |
|||
10113 DATA 0,96,56,72,72,56,8,8 |
|||
10114 DATA 0,0,0,176,200,128,128,0 |
|||
10115 DATA 0,0,96,128,96,16,96,0 |
|||
10116 DATA 0,0,64,224,64,64,32,0 |
|||
10117 DATA 0,0,0,144,144,144,104,0 |
|||
10118 DATA 0,0,0,136,136,80,32,0 |
|||
10119 DATA 0,0,0,136,168,168,80,0 |
|||
10120 DATA 0,0,0,72,48,48,72,0 |
|||
10121 DATA 0,0,136,80,32,64,128,0 |
|||
10122 DATA 0,0,248,16,32,64,248,0 |
|||
10123 DATA 16,32,32,64,32,32,16,0 |
|||
10124 DATA 32,32,32,0,32,32,32,0 |
|||
10125 DATA 64,32,32,16,32,32,64,0 |
|||
10126 DATA 108,144,0,0,0,0,0,0 |
|||
10127 DATA 112,80,80,80,80,80,112,0 |
|||
10128 DATA 0,0,0,0,0,0,0,0 |
|||
10129 DATA 0,0,0,0,0,0,0,0 |
|||
10130 DATA 0,0,0,0,0,0,0,0 |
|||
10131 DATA 0,0,0,0,0,0,0,0 |
|||
10132 DATA 0,0,0,0,0,0,0,0 |
|||
10133 DATA 0,0,0,0,0,0,0,0 |
|||
10134 DATA 0,0,0,0,0,0,0,0 |
|||
10135 DATA 0,0,0,0,0,0,0,0 |
|||
10136 DATA 0,0,0,0,0,0,0,0 |
|||
10137 DATA 0,0,0,0,0,0,0,0 |
|||
10138 DATA 0,0,0,0,0,0,0,0 |
|||
10139 DATA 0,0,0,0,0,0,0,0 |
|||
10140 DATA 0,0,0,0,0,0,0,0 |
|||
10141 DATA 0,0,0,0,0,0,0,0 |
|||
10142 DATA 0,0,0,0,0,0,0,0 |
|||
10143 DATA 0,0,0,0,0,0,0,0 |
|||
10144 DATA 0,0,0,0,0,0,0,0 |
|||
10145 DATA 0,0,0,0,0,0,0,0 |
|||
10146 DATA 0,0,0,0,0,0,0,0 |
|||
10147 DATA 0,0,0,0,0,0,0,0 |
|||
10148 DATA 0,0,0,0,0,0,0,0 |
|||
10149 DATA 0,0,0,0,0,0,0,0 |
|||
10150 DATA 0,0,0,0,0,0,0,0 |
|||
10151 DATA 0,0,0,0,0,0,0,0 |
|||
10152 DATA 0,0,0,0,0,0,0,0 |
|||
10153 DATA 0,0,0,0,0,0,0,0 |
|||
10154 DATA 0,0,0,0,0,0,0,0 |
|||
10155 DATA 0,0,0,0,0,0,0,0 |
|||
10156 DATA 0,0,0,0,0,0,0,0 |
|||
10157 DATA 0,0,0,0,0,0,0,0 |
|||
10158 DATA 0,0,0,0,0,0,0,0 |
|||
10159 DATA 0,0,0,0,0,0,0,0 |
|||
10160 DATA 32,64,240,8,120,136,112,0 |
|||
10161 DATA 16,32,0,96,32,32,248,0 |
|||
10162 DATA 16,32,0,112,136,136,112,0 |
|||
10163 DATA 16,32,0,136,136,136,116,0 |
|||
10164 DATA 16,32,0,176,200,136,136,0 |
|||
10165 DATA 16,32,0,200,168,152,136,0 |
|||
10166 DATA 112,136,136,124,0,252,0,0 |
|||
10167 DATA 112,136,136,112,0,252,0,0 |
|||
10168 DATA 32,0,32,32,64,136,112,0 |
|||
10169 DATA 0,0,0,0,252,128,128,128 |
|||
10170 DATA 0,0,0,0,252,4,4,4 |
|||
10171 DATA 136,144,168,84,136,28,0,0 |
|||
10172 DATA 136,144,168,88,184,8,0,0 |
|||
10173 DATA 48,0,48,120,120,48,0,0 |
|||
10174 DATA 20,40,80,160,80,40,20,0 |
|||
10175 DATA 160,80,40,20,40,80,160,0 |
|||
10176 DATA 84,170,84,170,84,170,84,170 |
|||
10177 DATA 170,84,170,84,170,84,170,84 |
|||
10178 DATA 182,108,218,182,108,218,182,108 |
|||
10179 DATA 24,24,24,24,24,24,24,24 |
|||
10180 DATA 24,24,24,24,248,24,24,24 |
|||
10181 DATA 24,24,24,248,24,248,24,24 |
|||
10182 DATA 108,108,108,108,236,108,108,108 |
|||
10183 DATA 0,0,0,0,252,108,108,108 |
|||
10184 DATA 0,0,0,252,108,236,108,108 |
|||
10185 DATA 108,108,236,12,236,108,108,108 |
|||
10186 DATA 108,108,108,108,108,108,108,108 |
|||
10187 DATA 0,0,252,14,238,108,108,108 |
|||
10188 DATA 108,108,236,12,252,0,0,0 |
|||
10189 DATA 100,100,252,0,0,0,0,0 |
|||
10190 DATA 48,48,240,48,48,240,0,0 |
|||
10191 DATA 0,0,0,0,240,48,48,48 |
|||
10192 DATA 48,48,48,48,60,0,0,0 |
|||
10193 DATA 48,48,48,48,252,0,0,0 |
|||
10194 DATA 0,0,0,0,252,48,48,48 |
|||
10195 DATA 48,48,48,48,60,48,48,48 |
|||
10196 DATA 0,0,0,0,252,0,0,0 |
|||
10197 DATA 48,48,48,48,252,48,48,48 |
|||
10198 DATA 48,48,60,48,60,48,48,48 |
|||
10199 DATA 216,216,220,216,216,216,216,216 |
|||
10200 DATA 216,216,216,220,192,252,0,0 |
|||
10201 DATA 0,0,0,252,192,220,216,216 |
|||
10202 DATA 216,216,216,220,192,0,252,0 |
|||
10203 DATA 0,0,0,0,0,0,252,0 |
|||
10204 DATA 216,216,216,220,192,220,216,216 |
|||
10205 DATA 0,0,0,252,0,252,0,0 |
|||
10206 DATA 216,216,216,220,0,220,216,216 |
|||
10207 DATA 48,48,48,252,0,0,252,0 |
|||
10208 DATA 216,216,216,252,0,0,0,0 |
|||
10209 DATA 0,0,252,0,0,252,48,48 |
|||
10210 DATA 0,0,0,0,0,252,216,216 |
|||
10211 DATA 216,216,216,252,0,0,0,0 |
|||
10212 DATA 48,48,48,60,48,48,60,0 |
|||
10213 DATA 0,0,0,62,48,62,48,48 |
|||
10214 DATA 0,0,0,0,0,252,216,216 |
|||
10215 DATA 216,216,216,216,220,216,216,216 |
|||
10216 DATA 48,48,252,0,0,252,48,48 |
|||
10217 DATA 48,48,48,240,0,0,0,0 |
|||
10218 DATA 0,0,0,60,48,48,48,48 |
|||
10219 DATA 252,252,252,252,252,252,252,252 |
|||
10220 DATA 0,0,0,252,252,252,192,192 |
|||
10221 DATA 192,192,192,192,192,192,192,192 |
|||
10222 DATA 12,12,12,12,12,12,12,12 |
|||
10223 DATA 12,12,12,12,252,252,252,0 |
|||
10224 DATA 0,0,0,104,144,144,104,0 |
|||
10225 DATA 112,136,136,176,136,136,240,64 |
|||
10226 DATA 240,144,128,128,128,128,128,0 |
|||
10227 DATA 248,80,80,80,80,72,0,0 |
|||
10228 DATA 248,136,64,32,64,136,248,0 |
|||
10229 DATA 0,0,0,124,136,136,112,0 |
|||
10230 DATA 0,0,0,136,136,136,112,128 |
|||
10231 DATA 0,0,116,152,16,16,28,0 |
|||
10232 DATA 252,16,56,68,56,16,252,0 |
|||
10233 DATA 48,204,204,252,204,204,56,0 |
|||
10234 DATA 120,132,132,132,72,72,132,0 |
|||
10235 DATA 60,64,56,68,68,68,56,0 |
|||
10236 DATA 0,0,108,146,146,108,0,0 |
|||
10237 DATA 0,0,0,56,88,104,112,0 |
|||
10238 DATA 56,64,128,248,128,64,56,0 |
|||
10239 DATA 0,0,48,204,204,204,204,0 |
|||
10240 DATA 252,0,0,252,0,0,252,0 |
|||
10241 DATA 16,16,124,16,16,0,254,0 |
|||
10242 DATA 32,16,8,16,32,0,254,0 |
|||
10243 DATA 16,32,64,32,16,0,254,0 |
|||
10244 DATA 24,52,48,48,48,48,48,48 |
|||
10245 DATA 48,48,48,48,48,48,176,112 |
|||
10246 DATA 48,48,0,252,0,48,48,0 |
|||
10247 DATA 0,100,152,0,100,152,0,0 |
|||
10248 DATA 56,68,68,56,0,0,0,0 |
|||
10249 DATA 0,56,56,0,0,0,0,0 |
|||
10250 DATA 0,0,56,0,0,0,0,0 |
|||
10251 DATA 14,8,8,72,40,24,8,0 |
|||
10252 DATA 0,0,0,176,72,72,72,0 |
|||
10253 DATA 0,0,240,60,64,128,248,0 |
|||
10254 DATA 252,252,252,252,252,252,252,252 |
|||
10255 DATA 0,0,0,0,0,0,0,0 |
|||
Binary file not shown.
@ -1,28 +0,0 @@ |
|||
/* testv5.c 8/30/2012 dwg - derived from Wayne's TESTV5.BAS */ |
|||
/* Simple VIDEO test for N8; I/O Base assumed as 128 */ |
|||
|
|||
#include "tms9918.h" |
|||
|
|||
int main(argc,argv) |
|||
int argc; |
|||
char *argv[]; |
|||
{ |
|||
vdp_clr16k(); |
|||
vdp_setregs(); |
|||
vdp_modes(); |
|||
vdp_pnt(); |
|||
vdp_pgt(); |
|||
vdp_colors(); |
|||
vdp_load_set450(); |
|||
|
|||
/* vdp_clr_regen(); */ |
|||
vdp_fill(); |
|||
|
|||
/* vdp_num_regen(); */ |
|||
/* vdp_clr_regen(); */ |
|||
/* vdp_sync_regen(); */ |
|||
|
|||
func700(); |
|||
/* vdp_display(); */ |
|||
} |
|||
|
|||
Binary file not shown.
@ -1,4 +0,0 @@ |
|||
cc testv5 |
|||
as testv5 |
|||
ln testv5.o -lc |
|||
|
|||
@ -1,473 +0,0 @@ |
|||
/* tms9918.h 8/31/2012 dwg - information from TI Docs */ |
|||
/* http://www1.cs.columbia.edu/~sedwards/papers/TMS9918.pdf */ |
|||
|
|||
/* TMS9918 Modes:
|
|||
|
|||
Graphics I |
|||
Grtaphics Mode I provides 256x192 pixel display for generating |
|||
pattern graphics in 15 colors plus transparent. |
|||
|
|||
Graphics II |
|||
Graphics mode II is an enhancement of Graphics Mode I, allowing |
|||
it to generate more complex color and pattern displays. |
|||
|
|||
Multicolor |
|||
The Muylticolor mode provides an unrestricted 64x48 |
|||
color-dot display employing 15 colors plus transparent. |
|||
|
|||
Text Mode |
|||
The Text Mode provides twenty-four 40-character in two colors |
|||
and is intended to maximize the capacity of the TV screen to |
|||
display alphanumeric characters. (24 lines of forty blocks (each 8x8). |
|||
|
|||
*/ |
|||
|
|||
#define BASE 128 |
|||
#define DATAP (BASE+24) |
|||
#define CMDP (BASE+25) |
|||
|
|||
#define WO_R0 |
|||
#define WOR0B6 |
|||
|
|||
|
|||
|
|||
|
|||
#define VDP_TRANSPARENT 0 |
|||
#define VDP_BLACK 1 |
|||
#define VDP_MED_GREEN 2 |
|||
#define VDP_LGREEN 3 |
|||
#define VDP_DBLUE 4 |
|||
#define VDP_LBLUE 5 |
|||
#define VDP_DRED 6 |
|||
#define VDP_CYAN 7 |
|||
#define VDP_MRED 8 |
|||
#define VDP_LRED 9 |
|||
#define VDP_DYELLOW 10 |
|||
#define VDP_LYELLOW 11 |
|||
#define VDP_DGREEN 12 |
|||
#define VDP_MAGENTA 13 |
|||
#define VDP_GRAY 14 |
|||
#define VDP_WHITE 15 |
|||
|
|||
unsigned char regen[24*40]; |
|||
|
|||
unsigned char data[256*8] = { |
|||
/* 10000 */ 0,0,0,0,0,0,0,0, |
|||
/* 10001 */ 0,0,0,60,60,48,48,48, |
|||
/* 10002 */ 0,0,0,240,240,48,48,48, |
|||
/* 10003 */ 48,48,48,60,60,0,0,0, |
|||
/* 10004 */ 48,48,48,240,240,0,0,0, |
|||
/* 10005 */ 48,48,48,48,48,48,48,48, |
|||
/* 10006 */ 0,0,0,255,255,0,0,0, |
|||
/* 10007 */ 0,32,112,248,112,32,0,0, |
|||
/* 10008 */ 248,216,136,0,136,216,248,0, |
|||
/* 10009 */ 0,0,0,0,0,0,0,0, |
|||
/* 10010 */ 0,0,0,0,0,0,0,0, |
|||
/* 10011 */ 24,24,32,96,144,96,0,0, |
|||
/* 10012 */ 32,80,32,32,112,32,0,0, |
|||
/* 10013 */ 0,0,0,0,0,0,0,0, |
|||
/* 10014 */ 0,0,0,0,0,0,0,0, |
|||
/* 10015 */ 168,80,80,216,80,80,168,0, |
|||
/* 10016 */ 48,48,48,252,252,48,48,48, |
|||
/* 10017 */ 16,48,112,240,112,48,16,0, |
|||
/* 10018 */ 32,112,32,32,32,112,32,0, |
|||
/* 10019 */ 80,80,80,80,0,80,0,0, |
|||
/* 10020 */ 120,168,168,104,40,40,0,0, |
|||
/* 10021 */ 48,48,48,252,252,0,0,0, |
|||
/* 10022 */ 0,0,0,252,252,48,48,48, |
|||
/* 10023 */ 48,48,48,240,240,48,48,48, |
|||
/* 10024 */ 32,112,32,32,32,32,32,32, |
|||
/* 10025 */ 48,48,48,60,60,48,48,48, |
|||
/* 10026 */ 0,16,24,252,24,16,0,0, |
|||
/* 10027 */ 0,32,96,252,96,32,0,0, |
|||
/* 10028 */ 0,0,0,0,0,0,0,0, |
|||
/* 10029 */ 0,0,0,0,0,0,0,0, |
|||
/* 10030 */ 0,0,0,0,0,0,0,0, |
|||
/* 10031 */ 0,0,0,0,0,0,0,0, |
|||
/* 10032 */ 0,0,0,0,0,0,0,0, |
|||
/* 10033 */ 48,120,120,48,0,48,0,0, |
|||
/* 10034 */ 216,216,80,0,0,0,0,0, |
|||
/* 10035 */ 72,72,252,72,72,252,72,72, |
|||
/* 10036 */ 32,120,160,120,36,248,32,0, |
|||
/* 10037 */ 0,200,208,32,88,152,0,0, |
|||
/* 10038 */ 48,72,72,80,96,144,120,0, |
|||
/* 10039 */ 48,48,64,0,0,0,0,0, |
|||
/* 10040 */ 16,32,32,32,32,32,16,0, |
|||
/* 10041 */ 32,16,16,16,16,16,32,0, |
|||
/* 10042 */ 32,168,112,248,112,168,32,0, |
|||
/* 10043 */ 0,32,32,248,32,32,0,0, |
|||
/* 10044 */ 0,0,0,0,0,48,48,64, |
|||
/* 10045 */ 0,0,0,252,0,0,0,0, |
|||
/* 10046 */ 0,0,0,0,0,48,48,0, |
|||
/* 10047 */ 4,8,16,32,64,128,0,0, |
|||
/* 10048 */ 112,152,168,168,168,200,112,0, |
|||
/* 10049 */ 32,96,32,32,32,32,248,0, |
|||
/* 10050 */ 32,80,16,32,64,128,248,0, |
|||
/* 10051 */ 112,136,8,112,8,136,112,0, |
|||
/* 10052 */ 48,80,144,248,16,16,16,0, |
|||
/* 10053 */ 248,128,128,240,8,136,112,0, |
|||
/* 10054 */ 56,64,128,240,136,136,112,0, |
|||
/* 10055 */ 248,8,16,32,32,32,32,0, |
|||
/* 10056 */ 112,136,136,112,136,136,112,0, |
|||
/* 10057 */ 112,136,136,120,8,136,112,0, |
|||
/* 10058 */ 0,48,48,0,48,48,0,0, |
|||
/* 10059 */ 0,48,48,0,48,48,96,0, |
|||
/* 10060 */ 16,32,64,128,64,32,16,0, |
|||
/* 10061 */ 0,0,252,0,252,0,0,0, |
|||
/* 10062 */ 64,32,16,8,16,32,64,0, |
|||
/* 10063 */ 112,136,8,48,32,0,32,0, |
|||
/* 10064 */ 112,136,184,176,128,128,112,0, |
|||
/* 10065 */ 32,80,136,248,136,136,136,0, |
|||
/* 10066 */ 240,72,72,112,72,72,240,0, |
|||
/* 10067 */ 112,136,128,128,128,136,112,0, |
|||
/* 10068 */ 240,72,72,72,72,72,240,0, |
|||
/* 10069 */ 248,136,128,224,128,136,248,0, |
|||
/* 10070 */ 248,136,128,240,128,128,128,0, |
|||
/* 10071 */ 112,136,128,184,136,136,112,0, |
|||
/* 10072 */ 136,136,136,248,136,136,136,0, |
|||
/* 10073 */ 248,32,32,32,32,32,248,0, |
|||
/* 10074 */ 28,8,8,8,8,136,112,0, |
|||
/* 10075 */ 136,144,160,192,160,144,136,0, |
|||
/* 10076 */ 128,128,128,128,128,136,248,0, |
|||
/* 10077 */ 136,216,168,136,136,136,136,0, |
|||
/* 10078 */ 136,200,168,168,168,152,136,0, |
|||
/* 10079 */ 112,136,136,136,136,136,112,0, |
|||
/* 10080 */ 240,136,136,240,128,128,128,0, |
|||
/* 10081 */ 112,136,136,136,168,152,120,4, |
|||
/* 10082 */ 240,136,136,240,160,144,136,0, |
|||
/* 10083 */ 112,136,64,32,16,136,112,0, |
|||
/* 10084 */ 248,32,32,32,32,32,112,0, |
|||
/* 10085 */ 136,136,136,136,136,136,112,0, |
|||
/* 10086 */ 136,136,136,80,80,80,32,0, |
|||
/* 10087 */ 136,136,136,168,168,168,80,0, |
|||
/* 10088 */ 136,136,80,32,80,136,136,0, |
|||
/* 10089 */ 136,136,80,32,32,32,32,0, |
|||
/* 10090 */ 248,136,16,32,64,136,248,0, |
|||
/* 10091 */ 120,64,64,64,64,64,120,0, |
|||
/* 10092 */ 0,128,64,32,16,8,0,0, |
|||
/* 10093 */ 120,8,8,8,8,8,120,0, |
|||
/* 10094 */ 32,80,136,0,0,0,0,0, |
|||
/* 10095 */ 0,0,0,0,0,0,252,0, |
|||
/* 10096 */ 96,96,16,0,0,0,0,0, |
|||
/* 10097 */ 0,0,240,8,120,136,112,0, |
|||
/* 10098 */ 128,128,128,240,136,136,240,0, |
|||
/* 10099 */ 0,0,0,112,128,128,112,0, |
|||
/* 10100 */ 8,8,8,120,136,136,120,0, |
|||
/* 10101 */ 0,0,112,136,248,128,112,0, |
|||
/* 10102 */ 0,48,72,224,64,64,64,0, |
|||
/* 10103 */ 0,0,56,72,72,56,8,112, |
|||
/* 10104 */ 0,128,128,176,200,136,136,0, |
|||
/* 10105 */ 0,0,32,0,96,32,112,0, |
|||
/* 10106 */ 0,8,0,24,8,8,72,48, |
|||
/* 10107 */ 128,128,144,160,192,160,144,0, |
|||
/* 10108 */ 32,32,32,32,32,32,32,0, |
|||
/* 10109 */ 0,0,0,80,168,168,136,0, |
|||
/* 10110 */ 0,0,0,176,200,136,136,0, |
|||
/* 10111 */ 0,0,0,112,136,136,112,0, |
|||
/* 10112 */ 0,0,112,72,72,112,64,64, |
|||
/* 10113 */ 0,96,56,72,72,56,8,8, |
|||
/* 10114 */ 0,0,0,176,200,128,128,0, |
|||
/* 10115 */ 0,0,96,128,96,16,96,0, |
|||
/* 10116 */ 0,0,64,224,64,64,32,0, |
|||
/* 10117 */ 0,0,0,144,144,144,104,0, |
|||
/* 10118 */ 0,0,0,136,136,80,32,0, |
|||
/* 10119 */ 0,0,0,136,168,168,80,0, |
|||
/* 10120 */ 0,0,0,72,48,48,72,0, |
|||
/* 10121 */ 0,0,136,80,32,64,128,0, |
|||
/* 10122 */ 0,0,248,16,32,64,248,0, |
|||
/* 10123 */ 16,32,32,64,32,32,16,0, |
|||
/* 10124 */ 32,32,32,0,32,32,32,0, |
|||
/* 10125 */ 64,32,32,16,32,32,64,0, |
|||
/* 10126 */ 108,144,0,0,0,0,0,0, |
|||
/* 10127 */ 112,80,80,80,80,80,112,0, |
|||
/* 10128 */ 0,0,0,0,0,0,0,0, |
|||
/* 10129 */ 0,0,0,0,0,0,0,0, |
|||
/* 10130 */ 0,0,0,0,0,0,0,0, |
|||
/* 10131 */ 0,0,0,0,0,0,0,0, |
|||
/* 10132 */ 0,0,0,0,0,0,0,0, |
|||
/* 10133 */ 0,0,0,0,0,0,0,0, |
|||
/* 10134 */ 0,0,0,0,0,0,0,0, |
|||
/* 10135 */ 0,0,0,0,0,0,0,0, |
|||
/* 10136 */ 0,0,0,0,0,0,0,0, |
|||
/* 10137 */ 0,0,0,0,0,0,0,0, |
|||
/* 10138 */ 0,0,0,0,0,0,0,0, |
|||
/* 10139 */ 0,0,0,0,0,0,0,0, |
|||
/* 10140 */ 0,0,0,0,0,0,0,0, |
|||
/* 10141 */ 0,0,0,0,0,0,0,0, |
|||
/* 10142 */ 0,0,0,0,0,0,0,0, |
|||
/* 10143 */ 0,0,0,0,0,0,0,0, |
|||
/* 10144 */ 0,0,0,0,0,0,0,0, |
|||
/* 10145 */ 0,0,0,0,0,0,0,0, |
|||
/* 10146 */ 0,0,0,0,0,0,0,0, |
|||
/* 10147 */ 0,0,0,0,0,0,0,0, |
|||
/* 10148 */ 0,0,0,0,0,0,0,0, |
|||
/* 10149 */ 0,0,0,0,0,0,0,0, |
|||
/* 10150 */ 0,0,0,0,0,0,0,0, |
|||
/* 10151 */ 0,0,0,0,0,0,0,0, |
|||
/* 10152 */ 0,0,0,0,0,0,0,0, |
|||
/* 10153 */ 0,0,0,0,0,0,0,0, |
|||
/* 10154 */ 0,0,0,0,0,0,0,0, |
|||
/* 10155 */ 0,0,0,0,0,0,0,0, |
|||
/* 10156 */ 0,0,0,0,0,0,0,0, |
|||
/* 10157 */ 0,0,0,0,0,0,0,0, |
|||
/* 10158 */ 0,0,0,0,0,0,0,0, |
|||
/* 10159 */ 0,0,0,0,0,0,0,0, |
|||
/* 10160 */ 32,64,240,8,120,136,112,0, |
|||
/* 10161 */ 16,32,0,96,32,32,248,0, |
|||
/* 10162 */ 16,32,0,112,136,136,112,0, |
|||
/* 10163 */ 16,32,0,136,136,136,116,0, |
|||
/* 10164 */ 16,32,0,176,200,136,136,0, |
|||
/* 10165 */ 16,32,0,200,168,152,136,0, |
|||
/* 10166 */ 112,136,136,124,0,252,0,0, |
|||
/* 10167 */ 112,136,136,112,0,252,0,0, |
|||
/* 10168 */ 32,0,32,32,64,136,112,0, |
|||
/* 10169 */ 0,0,0,0,252,128,128,128, |
|||
/* 10170 */ 0,0,0,0,252,4,4,4, |
|||
/* 10171 */ 136,144,168,84,136,28,0,0, |
|||
/* 10172 */ 136,144,168,88,184,8,0,0, |
|||
/* 10173 */ 48,0,48,120,120,48,0,0, |
|||
/* 10174 */ 20,40,80,160,80,40,20,0, |
|||
/* 10175 */ 160,80,40,20,40,80,160,0, |
|||
/* 10176 */ 84,170,84,170,84,170,84,170, |
|||
/* 10177 */ 170,84,170,84,170,84,170,84, |
|||
/* 10178 */ 182,108,218,182,108,218,182,108, |
|||
/* 10179 */ 24,24,24,24,24,24,24,24, |
|||
/* 10180 */ 24,24,24,24,248,24,24,24, |
|||
/* 10181 */ 24,24,24,248,24,248,24,24, |
|||
/* 10182 */ 108,108,108,108,236,108,108,108, |
|||
/* 10183 */ 0,0,0,0,252,108,108,108, |
|||
/* 10184 */ 0,0,0,252,108,236,108,108, |
|||
/* 10185 */ 108,108,236,12,236,108,108,108, |
|||
/* 10186 */ 108,108,108,108,108,108,108,108, |
|||
/* 10187 */ 0,0,252,14,238,108,108,108, |
|||
/* 10188 */ 108,108,236,12,252,0,0,0, |
|||
/* 10189 */ 100,100,252,0,0,0,0,0, |
|||
/* 10190 */ 48,48,240,48,48,240,0,0, |
|||
/* 10191 */ 0,0,0,0,240,48,48,48, |
|||
/* 10192 */ 48,48,48,48,60,0,0,0, |
|||
/* 10193 */ 48,48,48,48,252,0,0,0, |
|||
/* 10194 */ 0,0,0,0,252,48,48,48, |
|||
/* 10195 */ 48,48,48,48,60,48,48,48, |
|||
/* 10196 */ 0,0,0,0,252,0,0,0, |
|||
/* 10197 */ 48,48,48,48,252,48,48,48, |
|||
/* 10198 */ 48,48,60,48,60,48,48,48, |
|||
/* 10199 */ 216,216,220,216,216,216,216,216, |
|||
/* 10200 */ 216,216,216,220,192,252,0,0, |
|||
/* 10201 */ 0,0,0,252,192,220,216,216, |
|||
/* 10202 */ 216,216,216,220,192,0,252,0, |
|||
/* 10203 */ 0,0,0,0,0,0,252,0, |
|||
/* 10204 */ 216,216,216,220,192,220,216,216, |
|||
/* 10205 */ 0,0,0,252,0,252,0,0, |
|||
/* 10206 */ 216,216,216,220,0,220,216,216, |
|||
/* 10207 */ 48,48,48,252,0,0,252,0, |
|||
/* 10208 */ 216,216,216,252,0,0,0,0, |
|||
/* 10209 */ 0,0,252,0,0,252,48,48, |
|||
/* 10210 */ 0,0,0,0,0,252,216,216, |
|||
/* 10211 */ 216,216,216,252,0,0,0,0, |
|||
/* 10212 */ 48,48,48,60,48,48,60,0, |
|||
/* 10213 */ 0,0,0,62,48,62,48,48, |
|||
/* 10214 */ 0,0,0,0,0,252,216,216, |
|||
/* 10215 */ 216,216,216,216,220,216,216,216, |
|||
/* 10216 */ 48,48,252,0,0,252,48,48, |
|||
/* 10217 */ 48,48,48,240,0,0,0,0, |
|||
/* 10218 */ 0,0,0,60,48,48,48,48, |
|||
/* 10219 */ 252,252,252,252,252,252,252,252, |
|||
/* 10220 */ 0,0,0,252,252,252,192,192, |
|||
/* 10221 */ 192,192,192,192,192,192,192,192, |
|||
/* 10222 */ 12,12,12,12,12,12,12,12, |
|||
/* 10223 */ 12,12,12,12,252,252,252,0, |
|||
/* 10224 */ 0,0,0,104,144,144,104,0, |
|||
/* 10225 */ 112,136,136,176,136,136,240,64, |
|||
/* 10226 */ 240,144,128,128,128,128,128,0, |
|||
/* 10227 */ 248,80,80,80,80,72,0,0, |
|||
/* 10228 */ 248,136,64,32,64,136,248,0, |
|||
/* 10229 */ 0,0,0,124,136,136,112,0, |
|||
/* 10230 */ 0,0,0,136,136,136,112,128, |
|||
/* 10231 */ 0,0,116,152,16,16,28,0, |
|||
/* 10232 */ 252,16,56,68,56,16,252,0, |
|||
/* 10233 */ 48,204,204,252,204,204,56,0, |
|||
/* 10234 */ 120,132,132,132,72,72,132,0, |
|||
/* 10235 */ 60,64,56,68,68,68,56,0, |
|||
/* 10236 */ 0,0,108,146,146,108,0,0, |
|||
/* 10237 */ 0,0,0,56,88,104,112,0, |
|||
/* 10238 */ 56,64,128,248,128,64,56,0, |
|||
/* 10239 */ 0,0,48,204,204,204,204,0, |
|||
/* 10240 */ 252,0,0,252,0,0,252,0, |
|||
/* 10241 */ 16,16,124,16,16,0,254,0, |
|||
/* 10242 */ 32,16,8,16,32,0,254,0, |
|||
/* 10243 */ 16,32,64,32,16,0,254,0, |
|||
/* 10244 */ 24,52,48,48,48,48,48,48, |
|||
/* 10245 */ 48,48,48,48,48,48,176,112, |
|||
/* 10246 */ 48,48,0,252,0,48,48,0, |
|||
/* 10247 */ 0,100,152,0,100,152,0,0, |
|||
/* 10248 */ 56,68,68,56,0,0,0,0, |
|||
/* 10249 */ 0,56,56,0,0,0,0,0, |
|||
/* 10250 */ 0,0,56,0,0,0,0,0, |
|||
/* 10251 */ 14,8,8,72,40,24,8,0, |
|||
/* 10252 */ 0,0,0,176,72,72,72,0, |
|||
/* 10253 */ 0,0,240,60,64,128,248,0, |
|||
/* 10254 */ 252,252,252,252,252,252,252,252, |
|||
/* 10255 */ 0,0,0,0,0,0,0,0 |
|||
}; |
|||
|
|||
|
|||
vdp_clr16k() |
|||
{ |
|||
unsigned int a; |
|||
|
|||
printf("Let's set VDP write address to #0000 \n"); |
|||
out(CMDP,0); /* 0x00 - a6 a7 a8 a9 a10 a11 a12 a13 - all zeroes */ |
|||
out(CMDP,64); /* 0x40 - 01 a0 a1 a2 a3 a4 a5 - all zeroes */ |
|||
printf("Now let's clear first 16Kb of VDP memory\n"); |
|||
for(a=0;a<16384;a++) { |
|||
out(DATAP,0); |
|||
} |
|||
} |
|||
|
|||
vdp_setregs() |
|||
{ |
|||
printf("Now it's time to set up VDP registers\n"); |
|||
out(CMDP,0); /* 0x00 - 000000 - 0 M3 M3 of 0 required text mode */ |
|||
/* 0 EX EX of 0 disables extVDP inp */ |
|||
|
|||
out(CMDP,128); /* 0x80 - 1 0000 000 - reg 0 */ |
|||
} |
|||
|
|||
vdp_modes() |
|||
{ |
|||
printf("Select 40 column mode, "); |
|||
printf("enable screen and disable vertical interrupt\n"); |
|||
out(CMDP,80); /* 0x50 - 0101 0000 - 0 4/16K Select 4027 RAM operation */ |
|||
/* 1 BLANK Enables the active display */ |
|||
/* 0 IE Disables VDP interrupt */ |
|||
/* 1 M1 M1 of 1 is required for text mode */ |
|||
/* 0 M2 M2 of zero is required for text mode */ |
|||
/* 0 n/a */ |
|||
/* 0 SIZE 0 sprites 8x8 */ |
|||
/* 0 MAG 0 sprites 2X */ |
|||
out(CMDP,129); /* 0x81 - 1 0000 001 - reg 1 */ |
|||
} |
|||
|
|||
vdp_pnt() |
|||
{ |
|||
printf("Set pattern name table to #0000\n"); |
|||
out(CMDP,0); /* 0x00 - 0000 0000 - name table base addr 0 */ |
|||
out(CMDP,130); /* 0x82 - 1 0000 010 - reg 2 */ |
|||
} |
|||
|
|||
vdp_pgt() |
|||
{ |
|||
printf("Set pattern generator table to #800\n"); |
|||
out(CMDP,1); /* 0x01 - 00000 001 - pattern generator base addr 1 */ |
|||
out(CMDP,132); /* 0x84 - 1 0000 100 - reg 4 */ |
|||
} |
|||
|
|||
vdp_colors() |
|||
{ |
|||
printf("Set colors to white on black\n"); |
|||
out(CMDP,240); /* 0xF0 - 1111 0000 - (text=1111 bkgd=0000 */ |
|||
out(CMDP,135); /* 0x87 - 1 0000 111 - reg 7 */ |
|||
} |
|||
|
|||
vdp_load_set() |
|||
{ |
|||
int c,d,index; |
|||
|
|||
printf("Let's set VDP write address to #800 so "); |
|||
printf("that we can write character set to memory\n"); |
|||
out(CMDP,0); /* 0x00 - a6 a7 a8 a9 a10 a11 a12 a13 - all zeroes */ |
|||
out(CMDP,72); /* 0x48 - 01 a0=0 a1=0 a2=1 a3=0 a4=0 a5=0 */ |
|||
/* a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 */ |
|||
/* 0 0 0 1 0 0 0 0 0 0 0 0 0 0 */ |
|||
/* 000 1000 0000 0000 */ |
|||
|
|||
printf("Create a character set\n"); |
|||
|
|||
index=0; |
|||
for(c=0;c<256;c++) { |
|||
for(d=0;d<8;d++) { |
|||
out(DATAP,data[index++]); |
|||
} |
|||
} |
|||
} |
|||
|
|||
vdp_fill() |
|||
{ |
|||
int c,d; |
|||
|
|||
printf("Let's set write address to start of name table\n"); |
|||
|
|||
out(CMDP,0); |
|||
out(CMDP,64); /* 0x40 */ |
|||
printf("Let's put characters to screen\n"); |
|||
d = 0; |
|||
for(c=0;c<(40*24);c++) { |
|||
out(DATAP,d); |
|||
d++; |
|||
if(128 == d) d=0; |
|||
} |
|||
|
|||
} |
|||
|
|||
vdp_sync_regen() |
|||
{ |
|||
int c,d; |
|||
|
|||
printf("Let's set write address to start of name table\n"); |
|||
|
|||
out(CMDP,0); |
|||
out(CMDP,64); /* 0x40 */ |
|||
printf("Let's put characters to screen\n"); |
|||
d = 0; |
|||
for(c=0;c<(40*24);c++) { |
|||
out(DATAP,regen[c]); |
|||
} |
|||
} |
|||
|
|||
func700() |
|||
{ |
|||
out(CMDP,0); |
|||
out(CMDP,0); |
|||
} |
|||
|
|||
vdp_clr_regen() |
|||
{ |
|||
unsigned int index; |
|||
|
|||
for(index=0;index<(24*40);index++) { |
|||
regen[index] = ' '; |
|||
} |
|||
} |
|||
|
|||
vdp_set_regen() |
|||
{ |
|||
unsigned int index; |
|||
|
|||
for(index=0;index<40*24;index++) { |
|||
regen[index]=index&0x7f; |
|||
} |
|||
} |
|||
|
|||
vdp_num_regen() |
|||
{ |
|||
unsigned int index; |
|||
|
|||
for(index=0;index<40*24;index++) { |
|||
regen[index]=0x30+(index%10); |
|||
} |
|||
|
|||
} |
|||
|
|||
vdp_display() |
|||
{ |
|||
int c,v; |
|||
|
|||
for(c=0;c<17;c++) { |
|||
v = in(DATAP); |
|||
printf("0x2x ",v); |
|||
} |
|||
} |
|||
|
|||
|
|||
/* eof - tms9918.h */ |
|||
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +0,0 @@ |
|||
cc $1 |
|||
as $1 |
|||
ln $1.o -lc |
|||
|
|||
@ -1,67 +0,0 @@ |
|||
/* n8video.c 9/11/2012 dwg - derived from Wayne's TESTV5.BAS */ |
|||
/* Simple VIDEO test for N8; I/O Base assumed as 128 */ |
|||
|
|||
#include "applvers.h" |
|||
#include "tms9918.h" |
|||
|
|||
|
|||
char szTemp[128]; |
|||
char linenum; |
|||
char counter; |
|||
|
|||
char outer; |
|||
char inner; |
|||
char limit; |
|||
|
|||
int main(argc,argv) |
|||
int argc; |
|||
char *argv[]; |
|||
{ |
|||
int i; |
|||
char szTemp[64]; |
|||
unsigned char chardex; |
|||
|
|||
vdp_clr16k(); |
|||
vdp_setregs(); |
|||
vdp_modes(); |
|||
vdp_pnt(); |
|||
vdp_pgt(); |
|||
vdp_colors(); |
|||
vdp_load_set450(); |
|||
|
|||
if(outer == 3) style = TRIPLE; |
|||
vdp_main_frame("N8VIDTST(dwg)"); |
|||
chardex = 0; |
|||
|
|||
for(outer=0;outer<4;outer++) { |
|||
linenum = 4; |
|||
for(inner=0;inner<6;inner++) { |
|||
if(inner < 5) limit=11; |
|||
else limit=9; |
|||
for(i=0;i<limit;i++) { |
|||
sprintf(szTemp,"%c",chardex); |
|||
vdp_display(linenum,2+(i*3),szTemp); |
|||
sprintf(szTemp,"%02x",chardex++); |
|||
vdp_display(linenum+1,2+(i*3),szTemp); |
|||
} |
|||
linenum += 3; |
|||
if(inner==5) { |
|||
sprintf(szTemp,"Pg %d/4",outer+1); |
|||
vdp_display(20,29,szTemp); |
|||
} |
|||
} |
|||
if(outer < 3) { |
|||
vdp_display(22,2," Press any key to continue"); |
|||
gets(szTemp); |
|||
} |
|||
} |
|||
vdp_display(22,1,"Execution complete,returned to CP/M"); |
|||
|
|||
if(argc == 2) { |
|||
sprintf(szTemp,"%c",atoi(argv[1])); |
|||
vdp_display(1,WIDTH-2,szTemp); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
Binary file not shown.
@ -1,18 +0,0 @@ |
|||
readme - n8vidtst |
|||
|
|||
The n8vidtst program is a preliminary test program to help determine |
|||
that the TMS9918 chip on the N8 is working correctly in text mode. |
|||
|
|||
It displays four screens on the composite video, each displaying 64 |
|||
of the possible 256 characters in my prelimiinary character set. |
|||
|
|||
Everything is soft with the TMS9918, and the font is a set of character |
|||
array initializers in TMS9918.H. |
|||
|
|||
Aztec C for CP/M-80 is used to compile and link this program. |
|||
|
|||
The file N8VIDTST.CPM should be downloaded and renamed to n8vidtst.com |
|||
to run under CP/M on the N8. |
|||
|
|||
Questions? Ask doug@goodall.com, or use the N8VEM Forum on google. |
|||
|
|||
@ -1,637 +0,0 @@ |
|||
/* tms9918.h 9/11/2012 dwg - information from TI Docs */ |
|||
/* http://www1.cs.columbia.edu/~sedwards/papers/TMS9918.pdf */ |
|||
|
|||
/* To DO: fIX UPPER CASE T */ |
|||
|
|||
|
|||
/* TMS9918 Modes:
|
|||
|
|||
Graphics I |
|||
Grtaphics Mode I provides 256x192 pixel display for generating |
|||
pattern graphics in 15 colors plus transparent. |
|||
|
|||
Graphics II |
|||
Graphics mode II is an enhancement of Graphics Mode I, allowing |
|||
it to generate more complex color and pattern displays. |
|||
|
|||
Multicolor |
|||
The Muylticolor mode provides an unrestricted 64x48 |
|||
color-dot display employing 15 colors plus transparent. |
|||
|
|||
Text Mode |
|||
The Text Mode provides twenty-four 40-character in two colors |
|||
and is intended to maximize the capacity of the TV screen to |
|||
display alphanumeric characters. (24 lines of forty blocks (each 8x8). |
|||
|
|||
*/ |
|||
|
|||
/*
|
|||
#define DEBUG |
|||
*/ |
|||
|
|||
#define WIDTH 37 |
|||
#define HEIGHT 24 |
|||
#define GUTTER 3 |
|||
|
|||
#define BASE 128 |
|||
#define DATAP (BASE+24) |
|||
#define CMDP (BASE+25) |
|||
|
|||
#define WO_R0 |
|||
#define WOR0B6 |
|||
|
|||
#define VDP_TRANSPARENT 0 |
|||
#define VDP_BLACK 1 |
|||
#define VDP_MED_GREEN 2 |
|||
#define VDP_LGREEN 3 |
|||
#define VDP_DBLUE 4 |
|||
#define VDP_LBLUE 5 |
|||
#define VDP_DRED 6 |
|||
#define VDP_CYAN 7 |
|||
#define VDP_MRED 8 |
|||
#define VDP_LRED 9 |
|||
#define VDP_DYELLOW 10 |
|||
#define VDP_LYELLOW 11 |
|||
#define VDP_DGREEN 12 |
|||
#define VDP_MAGENTA 13 |
|||
#define VDP_GRAY 14 |
|||
#define VDP_WHITE 15 |
|||
|
|||
#define SINGLE 11 |
|||
#define TRIPLE 0 |
|||
char style; /* can be SINGLE or TRIPPLE */ |
|||
|
|||
unsigned char vdp_regen[24*40]; |
|||
|
|||
unsigned char charset[256*8] = { |
|||
/* 10000 */ 0,0,0,0,0,0,0,0, |
|||
/* 10001 */ 0,0,0,60,60,48,48,48, |
|||
/* 10002 */ 0,0,0,240,240,48,48,48, |
|||
/* 10003 */ 48,48,48,60,60,0,0,0, |
|||
/* 10004 */ 48,48,48,240,240,0,0,0, |
|||
/* 10005 */ 48,48,48,48,48,48,48,48, |
|||
/* 10006 */ 0,0,0,255,255,0,0,0, |
|||
/* 10007 */ 0,32,112,248,112,32,0,0, |
|||
/* 10008 */ 248,216,136,0,136,216,248,0, |
|||
/* 10009 */ 0,0,0,0,0,0,0,0, |
|||
/* 10010 */ 0,0,0,0,0,0,0,0, |
|||
/* 10011 */ 24,24,32,96,144,96,0,0, |
|||
/* 10012 */ 32,80,32,32,112,32,0,0, |
|||
/* 10013 */ 0,0,0,0,0,0,0,0, |
|||
/* 10014 */ 0,0,0,0,0,0,0,0, |
|||
/* 10015 */ 168,80,80,216,80,80,168,0, |
|||
/* 10016 */ 48,48,48,252,252,48,48,48, |
|||
/* 10017 */ 16,48,112,240,112,48,16,0, |
|||
/* 10018 */ 32,112,32,32,32,112,32,0, |
|||
/* 10019 */ 80,80,80,80,0,80,0,0, |
|||
/* 10020 */ 120,168,168,104,40,40,0,0, |
|||
/* 10021 */ 48,48,48,252,252,0,0,0, |
|||
/* 10022 */ 0,0,0,252,252,48,48,48, |
|||
/* 10023 */ 48,48,48,240,240,48,48,48, |
|||
/* 10024 */ 32,112,32,32,32,32,32,32, |
|||
/* 10025 */ 48,48,48,60,60,48,48,48, |
|||
/* 10026 */ 0,16,24,252,24,16,0,0, |
|||
/* 10027 */ 0,32,96,252,96,32,0,0, |
|||
/* 10028 */ 0,0,0,0,0,0,0,0, |
|||
/* 10029 */ 0,0,0,0,0,0,0,0, |
|||
/* 10030 */ 0,0,0,0,0,0,0,0, |
|||
/* 10031 */ 0,0,0,0,0,0,0,0, |
|||
/* 10032 */ 0,0,0,0,0,0,0,0, |
|||
/* 10033 */ 48,120,120,48,0,48,0,0, |
|||
/* 10034 */ 216,216,80,0,0,0,0,0, |
|||
/* 10035 */ 72,72,252,72,72,252,72,72, |
|||
/* 10036 */ 32,120,160,120,36,248,32,0, |
|||
/* 10037 */ 0,200,208,32,88,152,0,0, |
|||
/* 10038 */ 48,72,72,80,96,144,120,0, |
|||
/* 10039 */ 48,48,64,0,0,0,0,0, |
|||
/* 10040 */ 16,32,32,32,32,32,16,0, |
|||
/* 10041 */ 32,16,16,16,16,16,32,0, |
|||
/* 10042 */ 32,168,112,248,112,168,32,0, |
|||
/* 10043 */ 0,32,32,248,32,32,0,0, |
|||
/* 10044 */ 0,0,0,0,0,48,48,64, |
|||
|
|||
/* 10045 0,0,0,252,0,0,0,0, */ |
|||
/* 10045 */ 0,0,0,112,0,0,0,0, |
|||
|
|||
/* 10046 */ 0,0,0,0,0,48,48,0, |
|||
/* 10047 */ 4,8,16,32,64,128,0,0, |
|||
/* 10048 */ 112,152,168,168,168,200,112,0, |
|||
/* 10049 */ 32,96,32,32,32,32,248,0, |
|||
|
|||
/* 10050 32,80,16,32,64,128,248,0, */ |
|||
/* 10050 */ 112,136,8,16,96,128,248,0, |
|||
|
|||
/* 10051 */ 112,136,8,112,8,136,112,0, |
|||
/* 10052 */ 48,80,144,248,16,16,16,0, |
|||
/* 10053 */ 248,128,128,240,8,136,112,0, |
|||
/* 10054 */ 56,64,128,240,136,136,112,0, |
|||
/* 10055 */ 248,8,16,32,32,32,32,0, |
|||
/* 10056 */ 112,136,136,112,136,136,112,0, |
|||
/* 10057 */ 112,136,136,120,8,136,112,0, |
|||
/* 10058 */ 0,48,48,0,48,48,0,0, |
|||
/* 10059 */ 0,48,48,0,48,48,96,0, |
|||
/* 10060 */ 16,32,64,128,64,32,16,0, |
|||
/* 10061 */ 0,0,252,0,252,0,0,0, |
|||
/* 10062 */ 64,32,16,8,16,32,64,0, |
|||
/* 10063 */ 112,136,8,48,32,0,32,0, |
|||
/* 10064 */ 112,136,184,176,128,128,112,0, |
|||
/* 10065 */ 32,80,136,248,136,136,136,0, |
|||
/* 10066 */ 240,72,72,112,72,72,240,0, |
|||
/* 10067 */ 112,136,128,128,128,136,112,0, |
|||
/* 10068 */ 240,72,72,72,72,72,240,0, |
|||
/* 10069 */ 248,136,128,224,128,136,248,0, |
|||
/* 10070 */ 248,136,128,240,128,128,128,0, |
|||
/* 10071 */ 112,136,128,184,136,136,112,0, |
|||
/* 10072 */ 136,136,136,248,136,136,136,0, |
|||
/* 10073 */ 248,32,32,32,32,32,248,0, |
|||
/* 10074 */ 28,8,8,8,8,136,112,0, |
|||
/* 10075 */ 136,144,160,192,160,144,136,0, |
|||
/* 10076 */ 128,128,128,128,128,136,248,0, |
|||
/* 10077 */ 136,216,168,136,136,136,136,0, |
|||
/* 10078 */ 136,200,168,168,168,152,136,0, |
|||
/* 10079 */ 112,136,136,136,136,136,112,0, |
|||
/* 10080 */ 240,136,136,240,128,128,128,0, |
|||
/* 10081 */ 112,136,136,136,168,152,120,4, |
|||
/* 10082 */ 240,136,136,240,160,144,136,0, |
|||
/* 10083 */ 112,136,64,32,16,136,112,0, |
|||
/* 10084 */ 248,32,32,32,32,32,112-64-16,0, |
|||
/* 10085 */ 136,136,136,136,136,136,112,0, |
|||
/* 10086 */ 136,136,136,80,80,80,32,0, |
|||
/* 10087 */ 136,136,136,168,168,168,80,0, |
|||
/* 10088 */ 136,136,80,32,80,136,136,0, |
|||
/* 10089 */ 136,136,80,32,32,32,32,0, |
|||
/* 10090 */ 248,136,16,32,64,136,248,0, |
|||
/* 10091 */ 120,64,64,64,64,64,120,0, |
|||
/* 10092 */ 0,128,64,32,16,8,0,0, |
|||
/* 10093 */ 120,8,8,8,8,8,120,0, |
|||
/* 10094 */ 32,80,136,0,0,0,0,0, |
|||
/* 10095 */ 0,0,0,0,0,0,252,0, |
|||
/* 10096 */ 96,96,16,0,0,0,0,0, |
|||
/* 10097 */ 0,0,240,8,120,136,112,0, |
|||
/* 10098 */ 128,128,128,240,136,136,240,0, |
|||
/* 10099 */ 0,0,0,112,128,128,112,0, |
|||
/* 10100 */ 8,8,8,120,136,136,120,0, |
|||
/* 10101 */ 0,0,112,136,248,128,112,0, |
|||
/* 10102 */ 0,48,72,224,64,64,64,0, |
|||
/* 10103 */ 0,0,56,72,72,56,8,112, |
|||
/* 10104 */ 0,128,128,176,200,136,136,0, |
|||
/* 10105 */ 0,0,32,0,96,32,112,0, |
|||
/* 10106 */ 0,8,0,24,8,8,72,48, |
|||
/* 10107 */ 128,128,144,160,192,160,144,0, |
|||
/* 10108 */ 32,32,32,32,32,32,32,0, |
|||
/* 10109 */ 0,0,0,80,168,168,136,0, |
|||
/* 10110 */ 0,0,0,176,200,136,136,0, |
|||
/* 10111 */ 0,0,0,112,136,136,112,0, |
|||
/* 10112 */ 0,0,112,72,72,112,64,64, |
|||
/* 10113 */ 0,96,56,72,72,56,8,8, |
|||
/* 10114 */ 0,0,0,176,200,128,128,0, |
|||
/* 10115 */ 0,0,96,128,96,16,96,0, |
|||
/* 10116 */ 0,0,64,224,64,64,32,0, |
|||
/* 10117 */ 0,0,0,144,144,144,104,0, |
|||
/* 10118 */ 0,0,0,136,136,80,32,0, |
|||
/* 10119 */ 0,0,0,136,168,168,80,0, |
|||
/* 10120 */ 0,0,0,72,48,48,72,0, |
|||
/* 10121 */ 0,0,136,80,32,64,128,0, |
|||
/* 10122 */ 0,0,248,16,32,64,248,0, |
|||
/* 10123 */ 16,32,32,64,32,32,16,0, |
|||
/* 10124 */ 32,32,32,0,32,32,32,0, |
|||
/* 10125 */ 64,32,32,16,32,32,64,0, |
|||
/* 10126 */ 108,144,0,0,0,0,0,0, |
|||
/* 10127 */ 112,80,80,80,80,80,112,0, |
|||
|
|||
/****************************************************************/ |
|||
/* These are Douglas Goodall's personal tri-plex semi graphics */ |
|||
/* 10128 */ 252,128,188,160,172,168,168,168, /* upper left */ |
|||
/* 10129 */ 252,0,252,0,252,0,0,0, /* top horz */ |
|||
/* 10130 */ 252,4,244,20,212,84,84,84, /* upper right */ |
|||
/* 10131 */ 84,84,84,84,84,84,84,84, /* right vert */ |
|||
/* 10132 */ 84,84,84,212,20,244,4,252, /* lower right */ |
|||
/* 10133 */ 0,0,0,255,0,255,0,255, /* bottom horz */ |
|||
/* 10134 */ 168,168,168,172,160,188,128,252, /* lower left */ |
|||
/* 10135 */ 168,168,168,168,168,168,168,168, /* left vert */ |
|||
/* 10136 */ 168,168,172,160,172,168,168,168, /* left joint */ |
|||
/* 10137 */ 84,84,212,20,212,84,84,84, /* right joint */ |
|||
/* 10138 */ 0,0,252,0,252,0,0,0, /* inner horz */ |
|||
/****************************************************************/ |
|||
|
|||
/****************************************************************/ |
|||
/* These are Douglas Goodall's personal uni-plex semi graphics */ |
|||
/* 10139 */ 252,128,128,128,128,128,128,128, /* upper left */ |
|||
/* 10140 */ 252,0,0,0,0,0,0,0, /* top horz */ |
|||
/* 10141 */ 252,4,4,4,4,4,4,4, /* upper right */ |
|||
/* 10142 */ 4,4,4,4,4,4,4,4, /* right vert */ |
|||
/* 10143 */ 4,4,4,4,4,4,4,252, /* lower right */ |
|||
/* 10144 */ 0,0,0,0,0,0,0,252, /* bottom horz */ |
|||
/* 10145 */ 128,128,128,128,128,128,128,252, /* lower left */ |
|||
/* 10146 */ 128,128,128,128,128,128,128,128, /* left vert */ |
|||
/* 10147 */ 128,128,128,252,128,128,128,128, /* left joint */ |
|||
/* 10148 */ 4,4,4,252,4,4,4,4, /* right joint */ |
|||
/* 10149 */ 0,0,0,252,0,0,0,0, /* inner horz */ |
|||
/****************************************************************/ |
|||
|
|||
/* 10150 */ 0,0,0,0,0,0,0,0, |
|||
/* 10151 */ 0,0,0,0,0,0,0,0, |
|||
/* 10152 */ 0,0,0,0,0,0,0,0, |
|||
/* 10153 */ 0,0,0,0,0,0,0,0, |
|||
/* 10154 */ 0,0,0,0,0,0,0,0, |
|||
/* 10155 */ 0,0,0,0,0,0,0,0, |
|||
/* 10156 */ 0,0,0,0,0,0,0,0, |
|||
/* 10157 */ 0,0,0,0,0,0,0,0, |
|||
/* 10158 */ 0,0,0,0,0,0,0,0, |
|||
/* 10159 */ 0,0,0,0,0,0,0,0, |
|||
/* 10160 */ 32,64,240,8,120,136,112,0, |
|||
/* 10161 */ 16,32,0,96,32,32,248,0, |
|||
/* 10162 */ 16,32,0,112,136,136,112,0, |
|||
/* 10163 */ 16,32,0,136,136,136,116,0, |
|||
/* 10164 */ 16,32,0,176,200,136,136,0, |
|||
/* 10165 */ 16,32,0,200,168,152,136,0, |
|||
/* 10166 */ 112,136,136,124,0,252,0,0, |
|||
/* 10167 */ 112,136,136,112,0,252,0,0, |
|||
/* 10168 */ 32,0,32,32,64,136,112,0, |
|||
/* 10169 */ 0,0,0,0,252,128,128,128, |
|||
/* 10170 */ 0,0,0,0,252,4,4,4, |
|||
/* 10171 */ 136,144,168,84,136,28,0,0, |
|||
/* 10172 */ 136,144,168,88,184,8,0,0, |
|||
/* 10173 */ 48,0,48,120,120,48,0,0, |
|||
/* 10174 */ 20,40,80,160,80,40,20,0, |
|||
/* 10175 */ 160,80,40,20,40,80,160,0, |
|||
/* 10176 */ 84,170,84,170,84,170,84,170, |
|||
/* 10177 */ 170,84,170,84,170,84,170,84, |
|||
/* 10178 */ 182,108,218,182,108,218,182,108, |
|||
/* 10179 */ 24,24,24,24,24,24,24,24, |
|||
/* 10180 */ 24,24,24,24,248,24,24,24, |
|||
/* 10181 */ 24,24,24,248,24,248,24,24, |
|||
/* 10182 */ 108,108,108,108,236,108,108,108, |
|||
/* 10183 */ 0,0,0,0,252,108,108,108, |
|||
/* 10184 */ 0,0,0,252,108,236,108,108, |
|||
/* 10185 */ 108,108,236,12,236,108,108,108, |
|||
/* 10186 */ 108,108,108,108,108,108,108,108, |
|||
/* 10187 */ 0,0,252,14,238,108,108,108, |
|||
/* 10188 */ 108,108,236,12,252,0,0,0, |
|||
/* 10189 */ 100,100,252,0,0,0,0,0, |
|||
/* 10190 */ 48,48,240,48,48,240,0,0, |
|||
/* 10191 */ 0,0,0,0,240,48,48,48, |
|||
/* 10192 */ 48,48,48,48,60,0,0,0, |
|||
/* 10193 */ 48,48,48,48,252,0,0,0, |
|||
/* 10194 */ 0,0,0,0,252,48,48,48, |
|||
/* 10195 */ 48,48,48,48,60,48,48,48, |
|||
/* 10196 */ 0,0,0,0,252,0,0,0, |
|||
/* 10197 */ 48,48,48,48,252,48,48,48, |
|||
/* 10198 */ 48,48,60,48,60,48,48,48, |
|||
/* 10199 */ 216,216,220,216,216,216,216,216, |
|||
/* 10200 */ 216,216,216,220,192,252,0,0, |
|||
/* 10201 */ 0,0,0,252,192,220,216,216, |
|||
/* 10202 */ 216,216,216,220,192,0,252,0, |
|||
/* 10203 */ 0,0,0,0,0,0,252,0, |
|||
/* 10204 */ 216,216,216,220,192,220,216,216, |
|||
/* 10205 */ 0,0,0,252,0,252,0,0, |
|||
/* 10206 */ 216,216,216,220,0,220,216,216, |
|||
/* 10207 */ 48,48,48,252,0,0,252,0, |
|||
/* 10208 */ 216,216,216,252,0,0,0,0, |
|||
/* 10209 */ 0,0,252,0,0,252,48,48, |
|||
/* 10210 */ 0,0,0,0,0,252,216,216, |
|||
/* 10211 */ 216,216,216,252,0,0,0,0, |
|||
/* 10212 */ 48,48,48,60,48,48,60,0, |
|||
/* 10213 */ 0,0,0,62,48,62,48,48, |
|||
/* 10214 */ 0,0,0,0,0,252,216,216, |
|||
/* 10215 */ 216,216,216,216,220,216,216,216, |
|||
/* 10216 */ 48,48,252,0,0,252,48,48, |
|||
/* 10217 */ 48,48,48,240,0,0,0,0, |
|||
/* 10218 */ 0,0,0,60,48,48,48,48, |
|||
/* 10219 */ 252,252,252,252,252,252,252,252, |
|||
/* 10220 */ 0,0,0,252,252,252,192,192, |
|||
/* 10221 */ 192,192,192,192,192,192,192,192, |
|||
/* 10222 */ 12,12,12,12,12,12,12,12, |
|||
/* 10223 */ 12,12,12,12,252,252,252,0, |
|||
/* 10224 */ 0,0,0,104,144,144,104,0, |
|||
/* 10225 */ 112,136,136,176,136,136,240,64, |
|||
/* 10226 */ 240,144,128,128,128,128,128,0, |
|||
/* 10227 */ 248,80,80,80,80,72,0,0, |
|||
/* 10228 */ 248,136,64,32,64,136,248,0, |
|||
/* 10229 */ 0,0,0,124,136,136,112,0, |
|||
/* 10230 */ 0,0,0,136,136,136,112,128, |
|||
/* 10231 */ 0,0,116,152,16,16,28,0, |
|||
/* 10232 */ 252,16,56,68,56,16,252,0, |
|||
/* 10233 */ 48,204,204,252,204,204,56,0, |
|||
/* 10234 */ 120,132,132,132,72,72,132,0, |
|||
/* 10235 */ 60,64,56,68,68,68,56,0, |
|||
/* 10236 */ 0,0,108,146,146,108,0,0, |
|||
/* 10237 */ 0,0,0,56,88,104,112,0, |
|||
/* 10238 */ 56,64,128,248,128,64,56,0, |
|||
/* 10239 */ 0,0,48,204,204,204,204,0, |
|||
/* 10240 */ 252,0,0,252,0,0,252,0, |
|||
/* 10241 */ 16,16,124,16,16,0,254,0, |
|||
/* 10242 */ 32,16,8,16,32,0,254,0, |
|||
/* 10243 */ 16,32,64,32,16,0,254,0, |
|||
/* 10244 */ 24,52,48,48,48,48,48,48, |
|||
/* 10245 */ 48,48,48,48,48,48,176,112, |
|||
/* 10246 */ 48,48,0,252,0,48,48,0, |
|||
/* 10247 */ 0,100,152,0,100,152,0,0, |
|||
/* 10248 */ 56,68,68,56,0,0,0,0, |
|||
/* 10249 */ 0,56,56,0,0,0,0,0, |
|||
/* 10250 */ 0,0,56,0,0,0,0,0, |
|||
/* 10251 */ 14,8,8,72,40,24,8,0, |
|||
/* 10252 */ 0,0,0,176,72,72,72,0, |
|||
/* 10253 */ 0,0,240,60,64,128,248,0, |
|||
/* 10254 */ 252,252,252,252,252,252,252,252, |
|||
/* 10255 */ 0,0,0,0,0,0,0,0 |
|||
}; |
|||
|
|||
|
|||
vdp_read() |
|||
{ |
|||
char c,v; |
|||
|
|||
for(c=0;c<17;c++) { |
|||
v = in(DATAP); |
|||
printf("0x2x ",v); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
vdp_display(line,column,string) |
|||
int line; |
|||
int column; |
|||
char * string; |
|||
{ |
|||
char index; |
|||
|
|||
vdp_write_ram(GUTTER+(line*40)+column); |
|||
for(index=0;index<strlen(string);index++) { |
|||
out(DATAP,string[index]); |
|||
} |
|||
} |
|||
|
|||
vdp_pad(line,column,string) |
|||
int line; |
|||
int column; |
|||
char * string; |
|||
{ |
|||
char index; |
|||
|
|||
vdp_write_ram(GUTTER+(line*40)+column); |
|||
for(index=0;index<strlen(string);index++) { |
|||
out(DATAP,string[index]); |
|||
} |
|||
if(40>strlen(string)) { |
|||
for(index=strlen(string);index<40;index++) { |
|||
out(DATAP,' '); |
|||
} |
|||
} |
|||
} |
|||
|
|||
vdp_hz_join(line) |
|||
int line; |
|||
{ |
|||
char i; |
|||
char szTemp[2]; |
|||
|
|||
sprintf(szTemp,"%c",0x8a+style); |
|||
for(i=1;i<WIDTH-1;i++) { |
|||
vdp_display(line,i,szTemp); |
|||
} |
|||
|
|||
sprintf(szTemp,"%c",0x88+style); |
|||
vdp_display(line,0,szTemp); |
|||
|
|||
sprintf(szTemp,"%c",0x89+style); |
|||
vdp_display(line,WIDTH-1,szTemp); |
|||
} |
|||
|
|||
|
|||
vdp_main_frame(name) |
|||
char * name; |
|||
{ |
|||
char i; |
|||
char szTemp[48]; |
|||
|
|||
sprintf(szTemp,"%c",0x81+style); |
|||
for(i=1;i<WIDTH-1;i++) { |
|||
vdp_display(0,i,szTemp); |
|||
} |
|||
|
|||
sprintf(szTemp,"%c",0x85+style); |
|||
for(i=1;i<WIDTH-1;i++) { |
|||
vdp_display(HEIGHT-1,i,szTemp); |
|||
} |
|||
|
|||
sprintf(szTemp,"%c",0x87+style); |
|||
for(i=1;i<HEIGHT-1;i++) { |
|||
vdp_display(i,0,szTemp); |
|||
} |
|||
|
|||
sprintf(szTemp,"%c",0x83+style); |
|||
for(i=1;i<HEIGHT-1;i++) { |
|||
vdp_display(i,WIDTH-1,szTemp); |
|||
} |
|||
|
|||
sprintf(szTemp,"%c",0x80+style); |
|||
vdp_display(0,0,szTemp); |
|||
|
|||
sprintf(szTemp,"%c",0x82+style); |
|||
vdp_display(0,WIDTH-1,szTemp); |
|||
|
|||
sprintf(szTemp,"%c",0x84+style); |
|||
vdp_display(HEIGHT-1,WIDTH-1,szTemp); |
|||
|
|||
sprintf(szTemp,"%c",0x86+style); |
|||
vdp_display(HEIGHT-1,0,szTemp); |
|||
|
|||
sprintf(szTemp,"%s %d/%d/%d Ver %d.%d.%d", |
|||
name,A_MONTH,A_DAY,A_YEAR,A_RMJ,A_RMN,A_RUP); |
|||
vdp_display(1,(WIDTH-strlen(szTemp))/2,szTemp); |
|||
|
|||
vdp_hz_join(2); |
|||
vdp_hz_join(HEIGHT-3); |
|||
} |
|||
|
|||
|
|||
vdp_clr16k() |
|||
{ |
|||
unsigned int a; |
|||
|
|||
#ifdef DEBUG |
|||
printf("Let's set VDP write address to #0000 \n"); |
|||
#endif |
|||
out(CMDP,0); /* 0x00 - a6 a7 a8 a9 a10 a11 a12 a13 - all zeroes */ |
|||
out(CMDP,64); /* 0x40 - 01 a0 a1 a2 a3 a4 a5 - all zeroes */ |
|||
#ifdef DEBUG |
|||
printf("Now let's clear first 16Kb of VDP memory\n"); |
|||
#endif |
|||
for(a=0;a<16384;a++) { |
|||
out(DATAP,0); |
|||
} |
|||
} |
|||
|
|||
vdp_setregs() |
|||
{ |
|||
#ifdef DEBUG |
|||
printf("Now it's time to set up VDP registers\n"); |
|||
#endif |
|||
out(CMDP,0); /* 0x00 - 000000 - 0 M3 M3 of 0 required text mode */ |
|||
/* 0 EX EX of 0 disables extVDP inp */ |
|||
|
|||
out(CMDP,128); /* 0x80 - 1 0000 000 - reg 0 */ |
|||
} |
|||
|
|||
vdp_modes() |
|||
{ |
|||
#ifdef DEBUG |
|||
printf("Select 40 column mode, "); |
|||
printf("enable screen and disable vertical interrupt\n"); |
|||
#endif |
|||
out(CMDP,80); /* 0x50 - 0101 0000 - 0 4/16K Select 4027 RAM operation */ |
|||
/* 1 BLANK Enables the active display */ |
|||
/* 0 IE Disables VDP interrupt */ |
|||
/* 1 M1 M1 of 1 is required for text mode */ |
|||
/* 0 M2 M2 of zero is required for text mode */ |
|||
/* 0 n/a */ |
|||
/* 0 SIZE 0 sprites 8x8 */ |
|||
/* 0 MAG 0 sprites 2X */ |
|||
out(CMDP,129); /* 0x81 - 1 0000 001 - reg 1 */ |
|||
} |
|||
|
|||
vdp_pnt() |
|||
{ |
|||
#ifdef DEBUG |
|||
printf("Set pattern name table to #0000\n"); |
|||
#endif |
|||
out(CMDP,0); /* 0x00 - 0000 0000 - name table base addr 0 */ |
|||
out(CMDP,130); /* 0x82 - 1 0000 010 - reg 2 */ |
|||
} |
|||
|
|||
vdp_pgt() |
|||
{ |
|||
#ifdef DEBUG |
|||
printf("Set pattern generator table to #800\n"); |
|||
#endif |
|||
out(CMDP,1); /* 0x01 - 00000 001 - pattern generator base addr 1 */ |
|||
out(CMDP,132); /* 0x84 - 1 0000 100 - reg 4 */ |
|||
} |
|||
|
|||
vdp_colors() |
|||
{ |
|||
#ifdef DEBUG |
|||
printf("Set colors to white on black\n"); |
|||
#endif |
|||
out(CMDP,240); /* 0xF0 - 1111 0000 - (text=1111 bkgd=0000 */ |
|||
out(CMDP,135); /* 0x87 - 1 0000 111 - reg 7 */ |
|||
} |
|||
|
|||
vdp_load_set() |
|||
{ |
|||
int c,d,index; |
|||
#ifdef DEBUG |
|||
printf("Let's set VDP write address to #800 so "); |
|||
printf("that we can write character set to memory\n"); |
|||
#endif |
|||
out(CMDP,0); /* 0x00 - a6 a7 a8 a9 a10 a11 a12 a13 - all zeroes */ |
|||
out(CMDP,72); /* 0x48 - 01 a0=0 a1=0 a2=1 a3=0 a4=0 a5=0 */ |
|||
/* a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 */ |
|||
/* 0 0 0 1 0 0 0 0 0 0 0 0 0 0 */ |
|||
/* 000 1000 0000 0000 */ |
|||
|
|||
#ifdef DEBUG |
|||
printf("Create a character set\n"); |
|||
#endif |
|||
index=0; |
|||
for(c=0;c<256;c++) { |
|||
for(d=0;d<8;d++) { |
|||
out(DATAP,charset[index++]); |
|||
} |
|||
} |
|||
} |
|||
|
|||
vdp_fill() |
|||
{ |
|||
int c; |
|||
char d; |
|||
|
|||
#ifdef DEBUG |
|||
printf("Let's set write address to start of name table\n"); |
|||
#endif |
|||
out(CMDP,0); |
|||
out(CMDP,64); /* 0x40 */ |
|||
#ifdef DEBUG |
|||
printf("Let's put characters to screen\n"); |
|||
#endif |
|||
d = 0; |
|||
for(c=0;c<(40*24);c++) { |
|||
out(DATAP,d); |
|||
d++; |
|||
if(128 == d) d=0; |
|||
} |
|||
|
|||
} |
|||
|
|||
vdp_sync_vdp_regen() |
|||
{ |
|||
int c,d; |
|||
|
|||
#ifdef DEBUG |
|||
printf("Let's set write address to start of name table\n"); |
|||
#endif |
|||
|
|||
out(CMDP,0); |
|||
out(CMDP,64); /* 0x40 */ |
|||
|
|||
#ifdef DEBUG |
|||
printf("Let's put characters to screen\n"); |
|||
#endif |
|||
d = 0; |
|||
for(c=0;c<(40*24);c++) { |
|||
out(DATAP,vdp_regen[c]); |
|||
} |
|||
} |
|||
|
|||
func700() |
|||
{ |
|||
out(CMDP,0); |
|||
out(CMDP,0); |
|||
} |
|||
|
|||
vdp_clr_vdp_regen() |
|||
{ |
|||
unsigned int index; |
|||
|
|||
for(index=0;index<(24*40);index++) { |
|||
vdp_regen[index] = ' '; |
|||
} |
|||
} |
|||
|
|||
vdp_set_vdp_regen() |
|||
{ |
|||
unsigned int index; |
|||
|
|||
for(index=0;index<40*24;index++) { |
|||
vdp_regen[index]=index&0x7f; |
|||
} |
|||
} |
|||
|
|||
vdp_num_vdp_regen() |
|||
{ |
|||
unsigned int index; |
|||
|
|||
for(index=0;index<40*24;index++) { |
|||
vdp_regen[index]=0x30+(index%10); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
vdp_write_vram(offset) |
|||
int offset; |
|||
{ |
|||
unsigned char byte1; |
|||
unsigned char byte2; |
|||
|
|||
byte1 = offset & 255; |
|||
byte2 = (offset >> 8) | 0x40; |
|||
out(CMDP,byte1); |
|||
out(CMDP,byte2); |
|||
} |
|||
|
|||
/* eof - tms9918.h */ |
|||
|
|||
Loading…
Reference in new issue