DimkaM

ay io test

Mar 25th, 2020
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <oscalls.h>
  4. #include <stdlib.h>
  5. #include <intrz80.h>
  6.  
  7. unsigned char iovalue = 0;
  8.  
  9. unsigned char scrredraw(void){
  10.     puts("\r\nTest AY IO ports");
  11.     printf("Current values 0x%02X",iovalue);
  12.     return 0;
  13. }
  14. void initMCU(void){
  15.     YIELD();
  16.     OS_SETGFX(6);
  17.     puts("\r\nTest AY IO ports");
  18. }
  19. #define wr_ay_reg(r, v) output(0xfffd,(r));\
  20.                         output(0xbffd,(v))
  21. void main (int argc, char *argv[])
  22. {
  23.     wr_ay_reg(7, 0xc0);
  24.     while(1){
  25.         wr_ay_reg(16, iovalue);
  26.         wr_ay_reg(17, iovalue);
  27.         printf("\rCurrent values 0x%02X",iovalue);
  28.         getchar();
  29.         iovalue ^= 0xff;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment