kopia lustrzana https://github.com/Jean-MarcHarvengt/MCUME
add VGA support to teensyuae41
rodzic
53115a9e26
commit
685294c420
|
@ -64,6 +64,28 @@ void AUDxDAT(int nr, uae_u16 v)
|
|||
#endif
|
||||
}
|
||||
|
||||
void AUDxLCH(int nr, uae_u16 v) { audio_channel[nr].lc = (audio_channel[nr].lc & 0xffff) | ((uae_u32)v << 16); }
|
||||
void AUDxLCL(int nr, uae_u16 v) { audio_channel[nr].lc = (audio_channel[nr].lc & ~0xffff) | (v & 0xFFFE); }
|
||||
void AUDxPER(int nr, uae_u16 v)
|
||||
{
|
||||
if (v <= 0) {
|
||||
#if 0 /* v == 0 is rather common, and harmless, and the value isn't signed anyway */
|
||||
static int warned = 0;
|
||||
if (!warned)
|
||||
write_log ("Broken program accessing the sound hardware\n"), warned++;
|
||||
#endif
|
||||
v = 65535;
|
||||
}
|
||||
if (v < maxhpos/2 && currprefs.produce_sound < 3)
|
||||
v = maxhpos/2;
|
||||
|
||||
audio_channel[nr].per = v;
|
||||
}
|
||||
|
||||
void AUDxVOL(int nr, uae_u16 v) { audio_channel[nr].vol = v & 64 ? 63 : v & 63; }
|
||||
void AUDxLEN(int nr, uae_u16 v) { audio_channel[nr].len = v; }
|
||||
|
||||
|
||||
/* Templates! I want templates! */
|
||||
void sample16_handler(void)
|
||||
{
|
||||
|
|
|
@ -10,6 +10,7 @@ extern struct audio_channel_data {
|
|||
uaecptr lc, pt, dmaen;
|
||||
int data_written, snum, state, intreq2, wper, wlen;
|
||||
uae_u16 dat, nextdat, vol, per, len;
|
||||
unsigned long adk_mask;
|
||||
int current_sample;
|
||||
} audio_channel[4];
|
||||
|
||||
|
@ -21,4 +22,9 @@ extern void aud3_handler(void);
|
|||
#endif
|
||||
|
||||
extern void AUDxDAT(int nr, uae_u16 value);
|
||||
extern void AUDxVOL(int nr, uae_u16 value);
|
||||
extern void AUDxPER(int nr, uae_u16 value);
|
||||
extern void AUDxLCH(int nr, uae_u16 value);
|
||||
extern void AUDxLCL(int nr, uae_u16 value);
|
||||
extern void AUDxLEN(int nr, uae_u16 value);
|
||||
|
||||
|
|
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
|
@ -6,7 +6,7 @@
|
|||
* (c) 1995 Bernd Schmidt
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
extern void DISK_init (void);
|
||||
extern void DISK_select (uae_u8 data);
|
||||
extern uae_u8 DISK_status (void);
|
||||
|
@ -20,5 +20,28 @@ extern void disk_swap(const char * disk0, const char * disk1);
|
|||
extern int DISK_ReadMFM (uaecptr);
|
||||
extern int DISK_PrepareReadMFM (int, uae_u16, int);
|
||||
extern void DISK_check_change (void);
|
||||
|
||||
*/
|
||||
// JMH: extern uae_u16* mfmwrite;
|
||||
|
||||
extern void DISK_init (void);
|
||||
extern void DISK_select (uae_u8 data);
|
||||
extern uae_u8 DISK_status (void);
|
||||
extern void DISK_GetData (uae_u16 *mfm, uae_u16 *byt);
|
||||
extern void DISK_InitWrite (void);
|
||||
extern void DISK_WriteData (int);
|
||||
extern void disk_eject (int num);
|
||||
extern int disk_empty (int num);
|
||||
extern void disk_insert (int num, const char *name);
|
||||
extern int DISK_ReadMFM (uaecptr);
|
||||
extern int DISK_PrepareReadMFM (int, uae_u16, int);
|
||||
extern void DISK_check_change (void);
|
||||
extern FILE *DISK_validate_filename (const char *, int, int *);
|
||||
extern void DISK_hsync_handler (void);
|
||||
extern int DISK_update_reads (uaecptr *, int *, int *, int);
|
||||
extern void DISK_reset_cycles (void);
|
||||
extern void DISK_StartRead (void);
|
||||
extern void DISK_search_sync (int, unsigned int);
|
||||
|
||||
extern void disk_swap(const char * disk0, const char * disk1);
|
||||
|
||||
extern uae_u16* mfmwrite;
|
||||
|
|
|
@ -31,7 +31,7 @@ typedef ULONG uaecptr;
|
|||
|
||||
|
||||
#define SOUND_PRESENT 1
|
||||
#define M68K_SPEED 4
|
||||
#define M68K_SPEED 8
|
||||
//#define HAS_BOGOMEM 1
|
||||
//#define HAS_MEMDISK 1
|
||||
#define HAS_EXPANMEM 1
|
||||
|
|
|
@ -5,8 +5,20 @@ extern "C" {
|
|||
#include "iopins.h"
|
||||
}
|
||||
|
||||
#ifdef HAS_T4_VGA
|
||||
#include "vga_t_dma.h"
|
||||
const vga_pixel deflogo[] = {
|
||||
0,0
|
||||
};
|
||||
static const vga_pixel * logo = deflogo;
|
||||
#else
|
||||
#include "tft_t_dma.h"
|
||||
#include "logo.h"
|
||||
const uint16_t deflogo[] = {
|
||||
0,0
|
||||
};
|
||||
static const uint16_t * logo = deflogo;
|
||||
#endif
|
||||
|
||||
#include "bmpjoy.h"
|
||||
#include "bmpvbar.h"
|
||||
#ifdef OLD_LAYOUT
|
||||
|
@ -93,7 +105,7 @@ static File file;
|
|||
#define MENU_FILE_YOFFSET (2*TEXT_HEIGHT)
|
||||
#define MENU_FILE_W (MAX_FILENAME_SIZE*TEXT_WIDTH)
|
||||
#define MENU_FILE_H (MAX_MENULINES*TEXT_HEIGHT)
|
||||
#define MENU_FILE_BGCOLOR RGBVAL16(0x00,0x00,0x20)
|
||||
#define MENU_FILE_BGCOLOR RGBVAL16(0x00,0x00,0x40)
|
||||
#define MENU_JOYS_YOFFSET (12*TEXT_HEIGHT)
|
||||
#define MENU_VBAR_XOFFSET (0*TEXT_WIDTH)
|
||||
#define MENU_VBAR_YOFFSET (MENU_FILE_YOFFSET)
|
||||
|
@ -115,10 +127,6 @@ static bool menuRedraw=true;
|
|||
|
||||
static int16_t calMinX=-1,calMinY=-1,calMaxX=-1,calMaxY=-1;
|
||||
static bool i2cKeyboardPresent = false;
|
||||
//const uint16_t deflogo[] = {
|
||||
// 0x0000,0x0000
|
||||
//};
|
||||
//static const uint16_t * logo = deflogo;
|
||||
static unsigned short * keys;
|
||||
static int keyMap;
|
||||
|
||||
|
@ -592,7 +600,7 @@ bool virtualkeyboardIsActive(void) {
|
|||
void toggleVirtualkeyboard(bool keepOn) {
|
||||
|
||||
if (keepOn) {
|
||||
tft.drawSpriteNoDma(0,0,(uint16_t*)logo);
|
||||
tft.drawSpriteNoDma(0,0,logo);
|
||||
//prev_zt = 0;
|
||||
vkbKeepOn = true;
|
||||
vkbActive = true;
|
||||
|
@ -609,7 +617,7 @@ void toggleVirtualkeyboard(bool keepOn) {
|
|||
}
|
||||
else {
|
||||
tft.stopDMA();
|
||||
tft.drawSpriteNoDma(0,0,(uint16_t*)logo);
|
||||
tft.drawSpriteNoDma(0,0,logo);
|
||||
//prev_zt = 0;
|
||||
vkbActive = true;
|
||||
exitVkbd = false;
|
||||
|
@ -654,7 +662,7 @@ void handleVirtualkeyboard() {
|
|||
|
||||
if (vkeyRefresh) {
|
||||
vkeyRefresh = false;
|
||||
tft.drawSpriteNoDma(0,0,(uint16_t*)logo, rx, ry, rw, rh);
|
||||
tft.drawSpriteNoDma(0,0,logo, rx, ry, rw, rh);
|
||||
}
|
||||
|
||||
if ( (exitVkbd) && (vkbActive) ) {
|
||||
|
@ -668,35 +676,35 @@ void handleVirtualkeyboard() {
|
|||
}
|
||||
|
||||
int emu_setKeymap(int index) {
|
||||
int xoff = 16;
|
||||
if (keyMap == 1) {
|
||||
keyMap = 0;
|
||||
keys = key_map1;
|
||||
tft.drawText(0, 0+16, " 1 I 2 I 3 I 4 I 5 I 6 I 7 I 8 I 9 I 10I", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), true);
|
||||
tft.drawText(0,16+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), false);
|
||||
tft.drawText(0,24+16, " q I w I e I r I t I y I u I i I o I p I", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), true);
|
||||
tft.drawText(0,40+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), false);
|
||||
tft.drawText(0,48+16, " a I s I d I f I g I h I j I k I l IRTNI", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), true);
|
||||
tft.drawText(0,64+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), false);
|
||||
tft.drawText(0,72+16, " z I x I c I v I b I n I m I , IDELISPCI", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), true);
|
||||
tft.drawText(0,88+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), false);
|
||||
tft.drawText(0,96+16,"mouse mode ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x00), false);
|
||||
tft.drawText(xoff, 0+16, " 1 I 2 I 3 I 4 I 5 I 6 I 7 I 8 I 9 I 10I", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), true);
|
||||
tft.drawText(xoff,16+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), false);
|
||||
tft.drawText(xoff,24+16, " q I w I e I r I t I y I u I i I o I p I", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), true);
|
||||
tft.drawText(xoff,40+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), false);
|
||||
tft.drawText(xoff,48+16, " a I s I d I f I g I h I j I k I l IRTNI", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), true);
|
||||
tft.drawText(xoff,64+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), false);
|
||||
tft.drawText(xoff,72+16, " z I x I c I v I b I n I m I , IDELISPCI", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), true);
|
||||
tft.drawText(xoff,88+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), false);
|
||||
tft.drawText(xoff,96+16, "mouse mode ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x00), false);
|
||||
delay(200);
|
||||
}
|
||||
else if (keyMap == 0) {
|
||||
keyMap = 1;
|
||||
keys = key_map2;
|
||||
tft.drawText(0, 0+16, "F1 IF2 IF3 IF4 IF5 IF6 IF7 IF8 IF9 IF10I", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), true);
|
||||
tft.drawText(0,16+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), false);
|
||||
tft.drawText(0,24+16, "PRNIDELIDELI r I t I y I u I i I o I p I", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), true);
|
||||
tft.drawText(0,40+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), false);
|
||||
tft.drawText(0,48+16, " a I s I d I f I g I h I j I k I l IRTNI", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), true);
|
||||
tft.drawText(0,64+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), false);
|
||||
tft.drawText(0,72+16, " z I x I c I v I b I n I m I , IDELISPCI", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), true);
|
||||
tft.drawText(0,88+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), false);
|
||||
tft.drawText(0,96+16,"joystick mode ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x00), false);
|
||||
tft.drawText(xoff, 0+16, "F1 IF2 IF3 IF4 IF5 IF6 IF7 IF8 IF9 IF10I", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), true);
|
||||
tft.drawText(xoff,16+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), false);
|
||||
tft.drawText(xoff,24+16, "PRNIDELIDELI r I t I y I u I i I o I p I", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), true);
|
||||
tft.drawText(xoff,40+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), false);
|
||||
tft.drawText(xoff,48+16, " a I s I d I f I g I h I j I k I l IRTNI", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), true);
|
||||
tft.drawText(xoff,64+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), false);
|
||||
tft.drawText(xoff,72+16, " z I x I c I v I b I n I m I , IDELISPCI", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), true);
|
||||
tft.drawText(xoff,88+16, "--- --- --- --- --- --- --- --- --- --- ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x80), false);
|
||||
tft.drawText(xoff,96+16, "joystick mode ", RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0x00), false);
|
||||
delay(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -768,10 +776,12 @@ void backgroundMenu(void) {
|
|||
menuRedraw=true;
|
||||
tft.fillScreenNoDma(RGBVAL16(0x00,0x00,0x00));
|
||||
tft.drawTextNoDma(0,0, TITLE, RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), true);
|
||||
tft.drawSpriteNoDma(MENU_VBAR_XOFFSET,MENU_VBAR_YOFFSET,(uint16_t*)bmpvbar);
|
||||
#ifndef HAS_T4_VGA
|
||||
tft.drawSpriteNoDma(MENU_VBAR_XOFFSET,MENU_VBAR_YOFFSET,bmpvbar);
|
||||
#endif
|
||||
#ifdef OLD_LAYOUT
|
||||
tft.drawSpriteNoDma(MENU_TFT_XOFFSET,MENU_TFT_YOFFSET,(uint16_t*)bmptft);
|
||||
tft.drawSpriteNoDma(MENU_VGA_XOFFSET,MENU_VGA_YOFFSET,(uint16_t*)bmpvga);
|
||||
tft.drawSpriteNoDma(MENU_TFT_XOFFSET,MENU_TFT_YOFFSET,bmptft);
|
||||
tft.drawSpriteNoDma(MENU_VGA_XOFFSET,MENU_VGA_YOFFSET,bmpvga);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -881,7 +891,7 @@ int handleMenu(uint16_t bClick)
|
|||
strcpy(selection,filename);
|
||||
}
|
||||
else {
|
||||
tft.drawTextNoDma(MENU_FILE_XOFFSET,i*TEXT_HEIGHT+MENU_FILE_YOFFSET, filename, 0xFFFF, 0x0000, true);
|
||||
tft.drawTextNoDma(MENU_FILE_XOFFSET,i*TEXT_HEIGHT+MENU_FILE_YOFFSET, filename, RGBVAL16(0xff,0xff,0xff), MENU_FILE_BGCOLOR, true);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
|
@ -889,8 +899,10 @@ int handleMenu(uint16_t bClick)
|
|||
fileIndex++;
|
||||
}
|
||||
|
||||
tft.drawSpriteNoDma(0,MENU_JOYS_YOFFSET,(uint16_t*)bmpjoy);
|
||||
tft.drawTextNoDma(48,MENU_JOYS_YOFFSET+8, (emu_SwapJoysticks(1)?(char*)"SWAP=1":(char*)"SWAP=0"), RGBVAL16(0x00,0xff,0xff), RGBVAL16(0xff,0x00,0x00), false);
|
||||
#ifndef HAS_T4_VGA
|
||||
tft.drawSpriteNoDma(0,MENU_JOYS_YOFFSET,(uint16_t*)bmpjoy);
|
||||
#endif
|
||||
tft.drawTextNoDma(48,MENU_JOYS_YOFFSET+8, (emu_SwapJoysticks(1)?(char*)"SWAP=1":(char*)"SWAP=0"), RGBVAL16(0x00,0xff,0xff), RGBVAL16(0x00,0x00,0xff), false);
|
||||
menuRedraw=false;
|
||||
}
|
||||
|
||||
|
@ -1459,5 +1471,3 @@ void emu_init(void)
|
|||
keys = key_map1;
|
||||
keyMap = 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#ifndef EMUAPI_H
|
||||
#define EMUAPI_H
|
||||
|
||||
//#define INVX 1
|
||||
//#define INVY 1
|
||||
#define HAS_SND 1
|
||||
#include "platform_config.h"
|
||||
|
||||
#define CUSTOM_SND 1
|
||||
#define HAS_I2CKBD 1
|
||||
//#define TIMER_REND 1
|
||||
|
@ -135,6 +134,7 @@ extern void emu_SetPaletteEntry(unsigned char r, unsigned char g, unsigned char
|
|||
extern void emu_DrawScreen(unsigned char * VBuf, int width, int height, int stride);
|
||||
extern void emu_DrawLine(unsigned char * VBuf, int width, int height, int line);
|
||||
extern void emu_DrawLine16(unsigned short * VBuf, int width, int height, int line);
|
||||
extern void emu_DrawLine8(unsigned char * VBuf, int width, int height, int line);
|
||||
extern void emu_DrawVsync(void);
|
||||
extern int emu_FrameSkip(void);
|
||||
extern void * emu_LineBuffer(int line);
|
||||
|
|
|
@ -22,7 +22,7 @@ struct ev
|
|||
|
||||
enum {
|
||||
ev_hsync, ev_copper, ev_cia,
|
||||
ev_blitter, ev_diskblk, ev_diskindex,
|
||||
ev_blitter, ev_diskblk, ev_diskindex, ev_disksync,
|
||||
#ifndef DONT_WANT_SOUND
|
||||
ev_aud0, ev_aud1, ev_aud2, ev_aud3,
|
||||
ev_sample,
|
||||
|
|
|
@ -35,6 +35,13 @@
|
|||
#define I2C_SDA_IO 18
|
||||
|
||||
// Analog joystick (primary) for JOY2 and 5 extra buttons
|
||||
#ifdef HAS_T4_VGA
|
||||
#define PIN_JOY2_A1X A3
|
||||
#define PIN_JOY2_A2Y A2
|
||||
#define PIN_JOY2_BTN 14
|
||||
#define PIN_KEY_USER1 5
|
||||
#define PIN_KEY_USER2 6
|
||||
#else
|
||||
#define PIN_JOY2_A1X A1
|
||||
#define PIN_JOY2_A2Y A2
|
||||
#define PIN_JOY2_BTN 17
|
||||
|
@ -49,6 +56,7 @@
|
|||
#define PIN_JOY1_2 7 // DOWN
|
||||
#define PIN_JOY1_3 6 // RIGHT
|
||||
#define PIN_JOY1_4 5 // LEFT
|
||||
#endif
|
||||
|
||||
#else
|
||||
// OLD LAYOUT!!!!
|
||||
|
@ -87,8 +95,3 @@
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,8 +2,13 @@
|
|||
#define _PLATFORM_CONFIG_H_
|
||||
|
||||
//#define OLD_LAYOUT 1
|
||||
#define HAS_T4_VGA 1
|
||||
|
||||
#define ILI9341 1
|
||||
//#define INVX 1
|
||||
//#define INVY 1
|
||||
//#define HAS_SND 1
|
||||
|
||||
//#define ILI9341 1
|
||||
//#define ST7789 1
|
||||
//#define SWAP_JOYSTICK 1
|
||||
//#define LOHRES 1
|
||||
|
@ -18,4 +23,3 @@
|
|||
//#define SDFSDEV "1:"
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#include "emuapi.h"
|
||||
|
||||
#include "keyboard_osd.h"
|
||||
#include "tft_t_dma.h"
|
||||
|
||||
//extern "C" {
|
||||
#include "uae.h"
|
||||
|
@ -35,7 +34,13 @@ uVGA uvga;
|
|||
uint8_t * VGA_frame_buffer;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_T4_VGA
|
||||
#include "vga_t_dma.h"
|
||||
TFT_T_DMA tft;
|
||||
#else
|
||||
#include "tft_t_dma.h"
|
||||
TFT_T_DMA tft = TFT_T_DMA(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCLK, TFT_MISO, TFT_TOUCH_CS, TFT_TOUCH_INT);
|
||||
#endif
|
||||
|
||||
bool vgaMode = false;
|
||||
|
||||
|
@ -71,7 +76,11 @@ void emu_DrawVsync(void)
|
|||
skip += 1;
|
||||
skip &= VID_FRAME_SKIP;
|
||||
if (!vgaMode) {
|
||||
#ifdef HAS_T4_VGA
|
||||
tft.waitSync();
|
||||
#else
|
||||
while (vbl==vb) {};
|
||||
#endif
|
||||
}
|
||||
#ifdef HAS_VGA
|
||||
else {
|
||||
|
@ -83,7 +92,11 @@ void emu_DrawVsync(void)
|
|||
void emu_DrawLine(unsigned char * VBuf, int width, int height, int line)
|
||||
{
|
||||
if (!vgaMode) {
|
||||
#ifdef HAS_T4_VGA
|
||||
tft.writeLine(width,1,line, VBuf, palette8);
|
||||
#else
|
||||
tft.writeLine(width,1,line, VBuf, palette16);
|
||||
#endif
|
||||
}
|
||||
#ifdef HAS_VGA
|
||||
else {
|
||||
|
@ -101,11 +114,26 @@ void emu_DrawLine(unsigned char * VBuf, int width, int height, int line)
|
|||
#endif
|
||||
}
|
||||
|
||||
void emu_DrawLine8(unsigned char * VBuf, int width, int height, int line)
|
||||
{
|
||||
if (!vgaMode) {
|
||||
if (skip==0) {
|
||||
#ifdef HAS_T4_VGA
|
||||
tft.writeLine(width,height,line, VBuf);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef HAS_VGA
|
||||
#endif
|
||||
}
|
||||
|
||||
void emu_DrawLine16(unsigned short * VBuf, int width, int height, int line)
|
||||
{
|
||||
if (!vgaMode) {
|
||||
if (skip==0) {
|
||||
#ifndef HAS_T4_VGA
|
||||
tft.writeLine(width,height,line, VBuf);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef HAS_VGA
|
||||
|
@ -116,7 +144,11 @@ void emu_DrawScreen(unsigned char * VBuf, int width, int height, int stride)
|
|||
{
|
||||
if (!vgaMode) {
|
||||
if (skip==0) {
|
||||
#ifdef HAS_T4_VGA
|
||||
tft.writeScreen(width,height-TFT_VBUFFER_YCROP,stride, VBuf+(TFT_VBUFFER_YCROP/2)*stride, palette8);
|
||||
#else
|
||||
tft.writeScreen(width,height-TFT_VBUFFER_YCROP,stride, VBuf+(TFT_VBUFFER_YCROP/2)*stride, palette16);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef HAS_VGA
|
||||
|
@ -168,7 +200,12 @@ void * emu_LineBuffer(int line)
|
|||
// ****************************************************
|
||||
void setup() {
|
||||
|
||||
tft.begin();
|
||||
#ifdef HAS_T4_VGA
|
||||
tft.begin(VGA_MODE_352x240);
|
||||
NVIC_SET_PRIORITY(IRQ_QTIMER3, 0);
|
||||
#else
|
||||
tft.begin();
|
||||
#endif
|
||||
|
||||
emu_init();
|
||||
|
||||
|
@ -239,8 +276,15 @@ void loop(void)
|
|||
|
||||
AudioPlaySystem mymixer;
|
||||
#if defined(__IMXRT1052__) || defined(__IMXRT1062__)
|
||||
#ifdef HAS_T4_VGA
|
||||
AudioOutputI2S i2s1;
|
||||
AudioConnection patchCord8(mymixer, 0, i2s1, 0);
|
||||
AudioConnection patchCord9(mymixer, 0, i2s1, 1);
|
||||
AudioControlSGTL5000 sgtl5000_1;
|
||||
#else
|
||||
AudioOutputMQS mqs;
|
||||
AudioConnection patchCord9(mymixer, 0, mqs, 1);
|
||||
#endif
|
||||
#else
|
||||
AudioOutputAnalog dac1;
|
||||
AudioConnection patchCord1(mymixer, dac1);
|
||||
|
@ -273,4 +317,3 @@ void emu_sndPlayBuzz(int size, int val) {
|
|||
//Serial.println(size);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
*/
|
||||
|
||||
#include "TFT_T_DMA.h"
|
||||
|
||||
#ifndef HAS_T4_VGA
|
||||
|
||||
#include "font8x8.h"
|
||||
|
||||
|
||||
|
@ -1231,8 +1234,7 @@ void TFT_T_DMA::drawSprite(int16_t x, int16_t y, const uint16_t *bitmap, uint16_
|
|||
l++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "emuapi.h"
|
||||
#ifdef HAS_T4_VGA
|
||||
#include "vga_t_dma.h"
|
||||
#else
|
||||
#include "tft_t_dma.h"
|
||||
#endif
|
||||
#include "iopins.h"
|
||||
|
||||
extern "C" {
|
||||
|
@ -79,8 +83,11 @@ char romfile[MAX_FILENAME] = "./kick13.rom";
|
|||
char prtname[MAX_FILENAME] = "lpr ";
|
||||
char sername[MAX_FILENAME] = "";
|
||||
char warning_buffer[256];
|
||||
static char slinebuf[800];
|
||||
|
||||
#ifdef HAS_T4_VGA
|
||||
static char slinebuf[WIN_W];
|
||||
#else
|
||||
static char slinebuf[WIN_W*2];
|
||||
#endif
|
||||
|
||||
#define MOUSE_STEP 3
|
||||
static int prev_hk = 0;
|
||||
|
@ -214,7 +221,11 @@ void write_log (const char *buf) { /*fprintf (stderr, buf); */ }
|
|||
void flush_line(int y)
|
||||
{
|
||||
if(y >= 0 && y < WIN_H) {
|
||||
#ifdef HAS_T4_VGA
|
||||
emu_DrawLine8((unsigned char *)slinebuf, WIN_W , 1, y);
|
||||
#else
|
||||
emu_DrawLine16((unsigned short *)slinebuf, WIN_W , 1, y);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -285,13 +296,20 @@ static int hddfound=0;
|
|||
void uae_Init(void)
|
||||
{
|
||||
emu_printf("Init");
|
||||
#ifdef HAS_T4_VGA
|
||||
gfxvidinfo.rowbytes = WIN_W;
|
||||
gfxvidinfo.pixbytes = 1;
|
||||
#else
|
||||
gfxvidinfo.rowbytes = WIN_W*2;
|
||||
gfxvidinfo.pixbytes = 2;
|
||||
#endif
|
||||
gfxvidinfo.maxlinetoscr = WIN_W;
|
||||
gfxvidinfo.maxline = WIN_H;
|
||||
gfxvidinfo.linemem = slinebuf;
|
||||
gfxvidinfo.maxblocklines = 0;
|
||||
|
||||
gfxvidinfo.width = WIN_W;
|
||||
gfxvidinfo.height = WIN_H;
|
||||
|
||||
buttonstate[0] = buttonstate[1] = buttonstate[2] = 0;
|
||||
lastmx = lastmy = 0;
|
||||
newmousecounters = 0;
|
||||
|
@ -407,35 +425,5 @@ void uae_Start(char * floppy1, char * floppy2)
|
|||
}
|
||||
|
||||
void uae_Step(void) {
|
||||
/*
|
||||
JoyState = 0;
|
||||
if (k & MASK_JOY2_DOWN) JoyState|=0x02;
|
||||
if (k & MASK_JOY2_UP) JoyState|=0x01;
|
||||
if (k & MASK_JOY2_LEFT) JoyState|=0x04;
|
||||
if (k & MASK_JOY2_RIGHT) JoyState|=0x08;
|
||||
if (k & MASK_JOY2_BTN) JoyState|=0x10;
|
||||
if (k & MASK_KEY_USER2) JoyState|=0x20;
|
||||
*/
|
||||
/*
|
||||
if (hk != 0) {
|
||||
emu_printh(hk);
|
||||
KeyMap[Keys[hk-1].Pos] &=~ Keys[hk-1].Mask;
|
||||
}
|
||||
else {
|
||||
memset(KeyMap,0xFF,16);
|
||||
}
|
||||
*/
|
||||
|
||||
//emu_DrawVsync();
|
||||
// not reached!
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
Wrapping class to extend VGA_T4 to TFT_T_DMA
|
||||
*/
|
||||
|
||||
#ifndef _VGA_T_DMAH_
|
||||
#define _VGA_T_DMAH_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <VGA_t4.h>
|
||||
#endif
|
||||
|
||||
|
||||
#define RGBVAL16(r,g,b) ( (((r>>5)&0x07)<<5) | (((g>>5)&0x07)<<2) | (((b>>6)&0x3)<<0) )
|
||||
#define RGBVAL8(r,g,b) ( (((r>>5)&0x07)<<5) | (((g>>5)&0x07)<<2) | (((b>>6)&0x3)<<0) )
|
||||
|
||||
|
||||
|
||||
|
||||
#define TFT_WIDTH 320 //640 //320
|
||||
#define TFT_REALWIDTH 320 //640 //320
|
||||
|
||||
#define TFT_HEIGHT 240
|
||||
#define TFT_REALHEIGHT 240
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
class TFT_T_DMA: public VGA_T4
|
||||
{
|
||||
public:
|
||||
// Fake touch screen functions
|
||||
bool isTouching(void) { return false; }
|
||||
void readRaw(uint16_t * oX, uint16_t * oY, uint16_t * oZ) { }
|
||||
void readCal(uint16_t * oX, uint16_t * oY, uint16_t * oZ) { };
|
||||
void callibrateTouch(uint16_t xMin,uint16_t yMin,uint16_t xMax,uint16_t yMax) { }
|
||||
|
||||
// fake DMA functions
|
||||
void startDMA(void) { };
|
||||
void stopDMA(void) { };
|
||||
|
||||
// fake no DMA functions
|
||||
void writeScreenNoDma(const vga_pixel *pcolors) { writeScreen(pcolors); }
|
||||
void fillScreenNoDma(vga_pixel color) { clear(color); }
|
||||
void drawTextNoDma(int16_t x, int16_t y, const char * text, vga_pixel fgcolor, vga_pixel bgcolor, bool doublesize) { drawText(x,y,text,fgcolor,bgcolor,doublesize); }
|
||||
void drawRectNoDma(int16_t x, int16_t y, int16_t w, int16_t h, vga_pixel color) { drawRect(x, y, w, h, color); }
|
||||
void drawSpriteNoDma(int16_t x, int16_t y, const vga_pixel *bitmap) { drawSprite(x, y, bitmap); }
|
||||
void drawSpriteNoDma(int16_t x, int16_t y, const vga_pixel *bitmap, uint16_t croparx, uint16_t cropary, uint16_t croparw, uint16_t croparh) { drawSprite(x, y, bitmap, croparx, cropary, croparw, croparh); }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -6,7 +6,14 @@
|
|||
* Copyright 1995-1997 Bernd Schmidt
|
||||
*/
|
||||
|
||||
#include "platform_config.h"
|
||||
#ifdef HAS_T4_VGA
|
||||
typedef unsigned char xcolnr;
|
||||
#else
|
||||
typedef unsigned short xcolnr;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
typedef int (*allocfunc_type)(int, int, int, xcolnr *);
|
||||
|
||||
|
@ -55,6 +62,8 @@ struct vidbuf_description
|
|||
* value than maxline here). */
|
||||
int can_double; /* Set if the high part of each entry in xcolors contains the same value
|
||||
* as the low part, so that two pixels can be drawn at once. */
|
||||
int width;
|
||||
int height;
|
||||
};
|
||||
|
||||
extern struct vidbuf_description gfxvidinfo;
|
||||
|
|
Ładowanie…
Reference in New Issue