kopia lustrzana https://github.com/Jean-MarcHarvengt/MCUME
emus updated for pico2zx
rodzic
fdc2f72477
commit
d0ce9f62f4
Plik binarny nie jest wyświetlany.
|
@ -6,7 +6,7 @@ include(pico_sdk_import.cmake)
|
|||
# We also need PICO EXTRAS
|
||||
#include(pico_extras_import.cmake)
|
||||
|
||||
#set(TARGET testkeymax)
|
||||
set(TARGET testkeymax)
|
||||
#set(TARGET pico20)
|
||||
#set(TARGET pico64)
|
||||
#set(TARGET pico81)
|
||||
|
@ -14,6 +14,7 @@ include(pico_sdk_import.cmake)
|
|||
#set(TARGET picospeccy)
|
||||
#set(TARGET picomsx)
|
||||
#set(TARGET pico8086)
|
||||
#set(TARGET picocastaway)
|
||||
#set(TARGET picocolem)
|
||||
#set(TARGET picoo2em)
|
||||
#set(TARGET picovcs)
|
||||
|
@ -21,7 +22,6 @@ include(pico_sdk_import.cmake)
|
|||
#set(TARGET picopce)
|
||||
#set(TARGET picosms)
|
||||
#set(TARGET picogen)
|
||||
set(TARGET picocastaway)
|
||||
|
||||
#set(TARGET pico5200)
|
||||
|
||||
|
@ -455,7 +455,7 @@ ENDIF()
|
|||
target_compile_definitions(${TARGET} PUBLIC N_SD_CARDS=${N_SD_CARDS})
|
||||
|
||||
|
||||
pico_enable_stdio_uart(${TARGET} TRUE)
|
||||
pico_enable_stdio_uart(${TARGET} FALSE)
|
||||
#pico_enable_stdio_usb(${TARGET} TRUE)
|
||||
|
||||
pico_add_extra_outputs(${TARGET})
|
||||
|
|
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
|
@ -7,6 +7,58 @@
|
|||
#define AUD_DMA_CHANNEL 4 // requires 1 or 3 channels
|
||||
#define PSR_DMA_CHANNEL 7 // requires 2 channels (PSRAM)
|
||||
|
||||
//#####################################################
|
||||
|
||||
#ifdef PICO2ZX
|
||||
|
||||
// Speaker
|
||||
#define AUDIO_PIN 0
|
||||
|
||||
// TFT
|
||||
#define TFT_SPIREG spi1
|
||||
#define TFT_SPIDREQ DREQ_SPI1_TX
|
||||
#define TFT_SCLK 10
|
||||
#define TFT_MOSI 11
|
||||
#define TFT_MISO 255
|
||||
#define TFT_DC 9
|
||||
#define TFT_CS 8 // 255 for LORES ST7789 (NO CS)
|
||||
#define TFT_RST 255 // 255 for ILI/ST if connected to 3.3V
|
||||
#define TFT_BACKLIGHT 255 // hardwired to 3.3v
|
||||
|
||||
// SD
|
||||
#define SD_SCLK 6
|
||||
#define SD_MOSI 7
|
||||
#define SD_MISO 4
|
||||
#define SD_CS 5
|
||||
#define SD_DETECT 255
|
||||
// Second SPI bus and DMA not conflicting with USB
|
||||
#define SD_SPIREG spi0
|
||||
|
||||
// HDMI
|
||||
#define HDMI_CLK_MINUS 0 // GPIO12
|
||||
#define HDMI_CLK_PLUS 1 // GPIO13
|
||||
#define HDMI_D0_MINUS 2 // GPIO14
|
||||
#define HDMI_D0_PLUS 3 // GPIO15
|
||||
#define HDMI_D1_MINUS 4 // GPIO16
|
||||
#define HDMI_D1_PLUS 5 // GPIO17
|
||||
#define HDMI_D2_MINUS 6 // GPIO18
|
||||
#define HDMI_D2_PLUS 7 // GPIO19
|
||||
|
||||
// KEYBOARD MATRIX
|
||||
#define RP_DAT 2
|
||||
#define RP_CLK 3
|
||||
#define KROWIN0 20
|
||||
#define KROWIN1 21
|
||||
#define KROWIN2 22
|
||||
#define KROWIN3 26
|
||||
#define KROWIN4 27
|
||||
#define KROWIN5 28
|
||||
#endif
|
||||
|
||||
//#####################################################
|
||||
|
||||
#ifdef PICOHYPERPET
|
||||
|
||||
// Speaker
|
||||
#define AUDIO_PIN 21
|
||||
|
||||
|
@ -41,11 +93,23 @@
|
|||
#define PSRAM_PIN_CS 9
|
||||
|
||||
#define PSRAM_ASYNC 1
|
||||
|
||||
#define PSRAM_SCLK 10
|
||||
#define PSRAM_MOSI 11
|
||||
#define PSRAM_MISO 8
|
||||
#define PSRAM_CS 9
|
||||
|
||||
#define PSRAM_SPIREG spi1
|
||||
|
||||
// HDMI
|
||||
#define HDMI_D0_PLUS 0 // GPIO12
|
||||
#define HDMI_D0_MINUS 1 // GPIO13
|
||||
#define HDMI_CLK_PLUS 2 // GPIO14
|
||||
#define HDMI_CLK_MINUS 3 // GPIO15
|
||||
#define HDMI_D2_PLUS 4 // GPIO16
|
||||
#define HDMI_D2_MINUS 5 // GPIO17
|
||||
#define HDMI_D1_PLUS 6 // GPIO18
|
||||
#define HDMI_D1_MINUS 7 // GPIO19
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
#ifndef _PLATFORM_CONFIG_H_
|
||||
#define _PLATFORM_CONFIG_H_
|
||||
|
||||
#define PICOHYPERPET 1
|
||||
//#define PICOHYPERPET 1
|
||||
#define PICO2ZX 1
|
||||
|
||||
#ifdef PICOHYPERPET
|
||||
|
||||
#define KEYLAYOUT KLAYOUT_UK
|
||||
|
||||
#define INVX 1
|
||||
|
@ -9,14 +13,27 @@
|
|||
#define USE_VGA 1
|
||||
#define HAS_USBHOST 1
|
||||
//#define HAS_USBPIO 1
|
||||
|
||||
//#define ILI9341 1
|
||||
//#define ST7789 1
|
||||
//#define SWAP_JOYSTICK 1
|
||||
//#define LOHRES 1
|
||||
//#define ROTATE_SCREEN 1
|
||||
//#define FLIP_SCREEN 1
|
||||
//#define HAS_PSRAM 1
|
||||
#define HAS_PSRAM 1
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef PICO2ZX
|
||||
|
||||
#define KEYLAYOUT KLAYOUT_UK
|
||||
|
||||
#define INVX 1
|
||||
#define HAS_SND 1
|
||||
#define ST7789 1
|
||||
//#define USE_VGA 1
|
||||
#define HAS_USBHOST 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_SND
|
||||
|
||||
|
|
|
@ -55,7 +55,9 @@ typedef struct
|
|||
unsigned int vol;
|
||||
} Channel;
|
||||
|
||||
static Channel chan[6] = {
|
||||
static Channel chan[8] = {
|
||||
{0,0,0},
|
||||
{0,0,0},
|
||||
{0,0,0},
|
||||
{0,0,0},
|
||||
{0,0,0},
|
||||
|
@ -77,12 +79,16 @@ static void snd_Reset(void)
|
|||
chan[3].vol = 0;
|
||||
chan[4].vol = 0;
|
||||
chan[5].vol = 0;
|
||||
chan[6].vol = 0;
|
||||
chan[7].vol = 0;
|
||||
chan[0].sinc = 0;
|
||||
chan[1].sinc = 0;
|
||||
chan[2].sinc = 0;
|
||||
chan[3].sinc = 0;
|
||||
chan[4].sinc = 0;
|
||||
chan[5].sinc = 0;
|
||||
chan[6].sinc = 0;
|
||||
chan[7].sinc = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -110,28 +116,33 @@ void AudioPlaySystem::snd_Mixer(short * stream, int len )
|
|||
int i;
|
||||
long s;
|
||||
//len = len >> 1;
|
||||
short v0=chan[0].vol;
|
||||
short v1=chan[1].vol;
|
||||
short v2=chan[2].vol;
|
||||
short v3=chan[3].vol;
|
||||
short v4=chan[4].vol;
|
||||
short v5=chan[5].vol;
|
||||
long v0=chan[0].vol;
|
||||
long v1=chan[1].vol;
|
||||
long v2=chan[2].vol;
|
||||
long v3=chan[3].vol;
|
||||
long v4=chan[4].vol;
|
||||
long v5=chan[5].vol;
|
||||
long v6=chan[6].vol;
|
||||
long v7=chan[7].vol;
|
||||
for (i=0;i<len;i++)
|
||||
{
|
||||
s =((v0*square[(chan[0].spos>>8)&0x3f])>>11);
|
||||
s+=((v1*square[(chan[1].spos>>8)&0x3f])>>11);
|
||||
s+=((v2*square[(chan[2].spos>>8)&0x3f])>>11);
|
||||
s+=((v3*noise[(chan[3].spos>>8)&(NOISEBSIZE-1)])>>11);
|
||||
s+=((v4*noise[(chan[4].spos>>8)&(NOISEBSIZE-1)])>>11);
|
||||
s+=((v5*noise[(chan[5].spos>>8)&(NOISEBSIZE-1)])>>11);
|
||||
*stream++ = (short)(s>>8 /*+ 32767*/);
|
||||
//*stream++ = (short)(s);
|
||||
s =v0*(square[(chan[0].spos>>8)&0x3f]+32767);
|
||||
s+=v1*(square[(chan[1].spos>>8)&0x3f]+32767);
|
||||
s+=v2*(square[(chan[2].spos>>8)&0x3f]+32767);
|
||||
s+=v3*(noise[(chan[3].spos>>8)&(NOISEBSIZE-1)]+32767);
|
||||
s+=v4*(noise[(chan[4].spos>>8)&(NOISEBSIZE-1)]+32767);
|
||||
s+=v5*(noise[(chan[5].spos>>8)&(NOISEBSIZE-1)]+32767);
|
||||
s+=v6*(square[(chan[6].spos>>8)&0x3f]+32767);
|
||||
s+=v7*(square[(chan[7].spos>>8)&0x3f]+32767);
|
||||
*stream++ = (short)(s >> (8+4+8)); // 8bits unsigned on 16bits
|
||||
chan[0].spos += chan[0].sinc;
|
||||
chan[1].spos += chan[1].sinc;
|
||||
chan[2].spos += chan[2].sinc;
|
||||
chan[3].spos += chan[3].sinc;
|
||||
chan[4].spos += chan[4].sinc;
|
||||
chan[5].spos += chan[5].sinc;
|
||||
chan[6].spos += chan[6].sinc;
|
||||
chan[7].spos += chan[7].sinc;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -169,7 +180,7 @@ bool AudioPlaySystem::isPlaying(void)
|
|||
|
||||
void AudioPlaySystem::sound(int C, int F, int V) {
|
||||
#ifndef CUSTOM_SND
|
||||
if (C < 6) {
|
||||
if (C < 8) {
|
||||
chan[C].vol = V;
|
||||
chan[C].sinc = F>>1;
|
||||
}
|
||||
|
|
|
@ -64,9 +64,12 @@ static char selected_filename[MAX_FILENAME_SIZE]="";
|
|||
static char files[MAX_FILES][MAX_FILENAME_SIZE];
|
||||
static bool menuRedraw=true;
|
||||
|
||||
#if (defined(PICOMPUTER) || defined(PICOZX) )
|
||||
#if ( defined(PICO2ZX) )
|
||||
#define RN 6
|
||||
#define CN 8
|
||||
static uint8_t rows[RN] = {KROWIN0,KROWIN1,KROWIN2,KROWIN3,KROWIN4,KROWIN5};
|
||||
static unsigned char keymatrix[RN];
|
||||
static const unsigned short * keys;
|
||||
static unsigned char keymatrix[7];
|
||||
static int keymatrix_hitrow=-1;
|
||||
static bool key_fn=false;
|
||||
static bool key_alt=false;
|
||||
|
@ -502,209 +505,78 @@ int emu_ReadKeys(void)
|
|||
if ( !gpio_get(PIN_KEY_USER4) ) retval |= MASK_KEY_USER4;
|
||||
#endif
|
||||
|
||||
|
||||
#if (defined(PICOMPUTER) || defined(PICOZX) )
|
||||
keymatrix_hitrow = -1;
|
||||
unsigned char row;
|
||||
#ifdef PICOZX
|
||||
unsigned short cols[7]={KCOLOUT1,KCOLOUT2,KCOLOUT3,KCOLOUT4,KCOLOUT5,KCOLOUT6,KCOLOUT7};
|
||||
unsigned char keymatrixtmp[7];
|
||||
for (int i=0;i<7;i++){
|
||||
#else
|
||||
unsigned short cols[6]={KCOLOUT1,KCOLOUT2,KCOLOUT3,KCOLOUT4,KCOLOUT5,KCOLOUT6};
|
||||
unsigned char keymatrixtmp[6];
|
||||
for (int i=0;i<6;i++){
|
||||
#endif
|
||||
gpio_set_dir(cols[i], GPIO_OUT);
|
||||
gpio_put(cols[i], 0);
|
||||
#ifdef SWAP_ALT_DEL
|
||||
sleep_us(1);
|
||||
//__asm volatile ("nop\n"); // 4-8ns
|
||||
#endif
|
||||
row=0;
|
||||
#ifdef PICOZX
|
||||
row |= (gpio_get(KROWIN1) ? 0 : 0x04);
|
||||
row |= (gpio_get(KROWIN1) ? 0 : 0x04);
|
||||
row |= (gpio_get(KROWIN1) ? 0 : 0x04);
|
||||
row |= (gpio_get(KROWIN1) ? 0 : 0x04);
|
||||
row |= (gpio_get(KROWIN2) ? 0 : 0x01);
|
||||
row |= (gpio_get(KROWIN3) ? 0 : 0x08);
|
||||
row |= (gpio_get(KROWIN4) ? 0 : 0x02);
|
||||
row |= (gpio_get(KROWIN5) ? 0 : 0x10);
|
||||
row |= (gpio_get(KROWIN6) ? 0 : 0x20);
|
||||
row |= (gpio_get(KROWIN7) ? 0 : 0x40);
|
||||
#else
|
||||
row |= (gpio_get(KROWIN2) ? 0 : 0x01);
|
||||
row |= (gpio_get(KROWIN2) ? 0 : 0x01);
|
||||
row |= (gpio_get(KROWIN2) ? 0 : 0x01);
|
||||
row |= (gpio_get(KROWIN2) ? 0 : 0x01);
|
||||
row |= (gpio_get(KROWIN4) ? 0 : 0x02);
|
||||
row |= (gpio_get(KROWIN1) ? 0 : 0x04);
|
||||
row |= (gpio_get(KROWIN3) ? 0 : 0x08);
|
||||
row |= (gpio_get(KROWIN5) ? 0 : 0x10);
|
||||
row |= (gpio_get(KROWIN6) ? 0 : 0x20);
|
||||
#endif
|
||||
//gpio_set_dir(cols[i], GPIO_OUT);
|
||||
gpio_put(cols[i], 1);
|
||||
gpio_set_dir(cols[i], GPIO_IN);
|
||||
gpio_disable_pulls(cols[i]);
|
||||
keymatrixtmp[i] = row;
|
||||
#if ( defined(PICO2ZX) )
|
||||
#define SAM 4
|
||||
#define STIM 50
|
||||
uint8_t row0=0;
|
||||
uint8_t row1=0;
|
||||
uint8_t row2=0;
|
||||
uint8_t row3=0;
|
||||
uint8_t row4=0;
|
||||
uint8_t row5=0;
|
||||
uint8_t bit=1;
|
||||
gpio_put(RP_DAT, 1);
|
||||
for (int j=0;j<SAM;j++) row0 |= (gpio_get(KROWIN0) ? 0 : bit);
|
||||
for (int j=0;j<SAM;j++) row1 |= (gpio_get(KROWIN1) ? 0 : bit);
|
||||
for (int j=0;j<SAM;j++) row2 |= (gpio_get(KROWIN2) ? 0 : bit);
|
||||
for (int j=0;j<SAM;j++) row3 |= (gpio_get(KROWIN3) ? 0 : bit);
|
||||
for (int j=0;j<SAM;j++) row4 |= (gpio_get(KROWIN4) ? 0 : bit);
|
||||
for (int j=0;j<SAM;j++) row5 |= (gpio_get(KROWIN5) ? 0 : bit);
|
||||
bit = bit << 1;
|
||||
gpio_put(RP_CLK, 0);
|
||||
sleep_us(STIM);
|
||||
for(int i = 0; i < (CN-1); i++) {
|
||||
gpio_put(RP_CLK, 1);
|
||||
sleep_us(STIM);
|
||||
for (int j=0;j<SAM;j++) row0 |= (gpio_get(KROWIN0) ? 0 : bit);
|
||||
for (int j=0;j<SAM;j++) row1 |= (gpio_get(KROWIN1) ? 0 : bit);
|
||||
for (int j=0;j<SAM;j++) row2 |= (gpio_get(KROWIN2) ? 0 : bit);
|
||||
for (int j=0;j<SAM;j++) row3 |= (gpio_get(KROWIN3) ? 0 : bit);
|
||||
for (int j=0;j<SAM;j++) row4 |= (gpio_get(KROWIN4) ? 0 : bit);
|
||||
for (int j=0;j<SAM;j++) row5 |= (gpio_get(KROWIN5) ? 0 : bit);
|
||||
gpio_put(RP_CLK, 0);
|
||||
sleep_us(STIM);
|
||||
bit = bit << 1;
|
||||
}
|
||||
|
||||
#ifdef SWAP_ALT_DEL
|
||||
// Swap ALT and DEL
|
||||
unsigned char alt = keymatrixtmp[0] & 0x02;
|
||||
unsigned char del = keymatrixtmp[5] & 0x20;
|
||||
keymatrixtmp[0] &= ~0x02;
|
||||
keymatrixtmp[5] &= ~0x20;
|
||||
if (alt) keymatrixtmp[5] |= 0x20;
|
||||
if (del) keymatrixtmp[0] |= 0x02;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PICOZX
|
||||
for (int i=0;i<7;i++){
|
||||
#else
|
||||
bool alt_pressed=false;
|
||||
if ( keymatrixtmp[5] & 0x20 ) {alt_pressed=true; keymatrixtmp[5] &= ~0x20;};
|
||||
for (int i=0;i<6;i++){
|
||||
#endif
|
||||
row = keymatrixtmp[i];
|
||||
if (row) keymatrix_hitrow=i;
|
||||
keymatrix[i] = row;
|
||||
}
|
||||
|
||||
#ifdef PICOZX
|
||||
//row = keymatrix[6];
|
||||
if ( row & 0x02 ) retval |= MASK_KEY_USER1;
|
||||
if ( row & 0x10 ) retval |= MASK_KEY_USER2;
|
||||
if ( row & 0x20 ) retval |= MASK_KEY_USER3;
|
||||
if ( row & 0x40 ) retval |= MASK_KEY_USER4;
|
||||
row = keymatrix[0];
|
||||
gpio_put(RP_DAT, 0);
|
||||
gpio_put(RP_CLK, 1);
|
||||
sleep_us(STIM);
|
||||
key_fn = false;
|
||||
key_alt = false;
|
||||
if ( row & 0x20 ) {key_fn = true; keymatrix[0] &= ~0x20;}
|
||||
if ( row & 0x40 ) {key_alt = true;keymatrix[0] &= ~0x40; }
|
||||
//19,20,21,22,26,27,28
|
||||
if ( row4 & 0x20 ) {key_fn = true; row4 &= ~0x20;}
|
||||
if ( row3 & 0x80 ) {key_alt = true; row3 &= ~0x80;}
|
||||
keymatrix[0] = row0;
|
||||
keymatrix[1] = row1;
|
||||
keymatrix[2] = row2;
|
||||
keymatrix[3] = row3;
|
||||
keymatrix[4] = row4;
|
||||
keymatrix[5] = row5;
|
||||
|
||||
if ( row5 & 0x01 ) retval |= MASK_KEY_USER1;
|
||||
if ( row5 & 0x04 ) retval |= MASK_KEY_USER2;
|
||||
if ( row5 & 0x02 ) retval |= MASK_KEY_USER3;
|
||||
|
||||
#if INVX
|
||||
if ( row & 0x2 ) retval |= MASK_JOY2_LEFT;
|
||||
if ( row & 0x1 ) retval |= MASK_JOY2_RIGHT;
|
||||
if ( row5 & 0x10 ) retval |= MASK_JOY2_LEFT;
|
||||
if ( row5 & 0x40 ) retval |= MASK_JOY2_RIGHT;
|
||||
#else
|
||||
if ( row & 0x1 ) retval |= MASK_JOY2_LEFT;
|
||||
if ( row & 0x2 ) retval |= MASK_JOY2_RIGHT;
|
||||
if ( row5 & 0x40 ) retval |= MASK_JOY2_LEFT;
|
||||
if ( row5 & 0x10 ) retval |= MASK_JOY2_RIGHT;
|
||||
#endif
|
||||
#if INVY
|
||||
if ( row & 0x8 ) retval |= MASK_JOY2_DOWN;
|
||||
if ( row & 0x10 ) retval |= MASK_JOY2_UP;
|
||||
if ( row5 & 0x20 ) retval |= MASK_JOY2_DOWN;
|
||||
if ( row5 & 0x08 ) retval |= MASK_JOY2_UP;
|
||||
#else
|
||||
if ( row & 0x10 ) retval |= MASK_JOY2_DOWN;
|
||||
if ( row & 0x8 ) retval |= MASK_JOY2_UP;
|
||||
if ( row5 & 0x08 ) retval |= MASK_JOY2_DOWN;
|
||||
if ( row5 & 0x20 ) retval |= MASK_JOY2_UP;
|
||||
#endif
|
||||
if ( row & 0x04 ) retval |= MASK_JOY2_BTN;
|
||||
if ( row5 & 0x80 ) retval |= MASK_JOY2_BTN;
|
||||
|
||||
#else // end PICOZX
|
||||
//6,9,15,8,7,22
|
||||
#if INVX
|
||||
if ( row & 0x2 ) retval |= MASK_JOY2_LEFT;
|
||||
if ( row & 0x1 ) retval |= MASK_JOY2_RIGHT;
|
||||
#else
|
||||
if ( row & 0x1 ) retval |= MASK_JOY2_LEFT;
|
||||
if ( row & 0x2 ) retval |= MASK_JOY2_RIGHT;
|
||||
#endif
|
||||
#if INVY
|
||||
if ( row & 0x8 ) retval |= MASK_JOY2_DOWN;
|
||||
if ( row & 0x4 ) retval |= MASK_JOY2_UP;
|
||||
#else
|
||||
if ( row & 0x4 ) retval |= MASK_JOY2_DOWN;
|
||||
if ( row & 0x8 ) retval |= MASK_JOY2_UP;
|
||||
#endif
|
||||
if ( row & 0x10 ) retval |= MASK_JOY2_BTN;
|
||||
|
||||
if ( key_fn ) retval |= MASK_KEY_USER2;
|
||||
if ( ( key_fn ) && (keymatrix[0] == 0x02 )) retval |= MASK_KEY_USER1;
|
||||
|
||||
// Handle LED flash
|
||||
uint32_t time_ms=to_ms_since_boot (get_absolute_time());
|
||||
if ((time_ms-last_t_ms) > 100) {
|
||||
last_t_ms = time_ms;
|
||||
if (ledflash_toggle == false) {
|
||||
ledflash_toggle = true;
|
||||
}
|
||||
else {
|
||||
ledflash_toggle = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( alt_pressed ) {
|
||||
if (key_fn == false)
|
||||
{
|
||||
// Release to Press transition
|
||||
if (hundred_ms_cnt == 0) {
|
||||
keypress_t_ms=time_ms;
|
||||
hundred_ms_cnt += 1; // 1
|
||||
}
|
||||
else {
|
||||
hundred_ms_cnt += 1; // 2
|
||||
if (hundred_ms_cnt >= 2)
|
||||
{
|
||||
hundred_ms_cnt = 0;
|
||||
/*
|
||||
if ( (time_ms-keypress_t_ms) < 500)
|
||||
{
|
||||
if (key_alt == false)
|
||||
{
|
||||
key_alt = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
key_alt = false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Keep press
|
||||
if (hundred_ms_cnt == 1) {
|
||||
if ((to_ms_since_boot (get_absolute_time())-keypress_t_ms) > 2000)
|
||||
{
|
||||
if (key_alt == false)
|
||||
{
|
||||
key_alt = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
key_alt = false;
|
||||
}
|
||||
hundred_ms_cnt = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
key_fn = true;
|
||||
keymatrix_hitrow = -1;
|
||||
for (int i=0;i<RN;i++){
|
||||
if (keymatrix[i]) keymatrix_hitrow=i;
|
||||
}
|
||||
else {
|
||||
key_fn = false;
|
||||
}
|
||||
|
||||
#ifdef KLED
|
||||
// Handle LED
|
||||
if (key_alt == true) {
|
||||
gpio_put(KLED, (ledflash_toggle?1:0));
|
||||
}
|
||||
else {
|
||||
if (key_fn == true) {
|
||||
gpio_put(KLED, 1);
|
||||
}
|
||||
else {
|
||||
gpio_put(KLED, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
//Serial.println(retval,HEX);
|
||||
|
@ -736,7 +608,7 @@ unsigned short emu_DebounceLocalKeys(void)
|
|||
|
||||
int emu_ReadI2CKeyboard(void) {
|
||||
int retval=0;
|
||||
#if (defined(PICOMPUTER) || defined(PICOZX) )
|
||||
#if ( defined(PICO2ZX) )
|
||||
if (key_alt) {
|
||||
keys = (const unsigned short *)key_map3;
|
||||
}
|
||||
|
@ -766,7 +638,7 @@ int emu_ReadI2CKeyboard(void) {
|
|||
|
||||
unsigned char emu_ReadI2CKeyboard2(int row) {
|
||||
int retval=0;
|
||||
#if (defined(PICOMPUTER) || defined(PICOZX) )
|
||||
#if ( defined(PICO2ZX) )
|
||||
retval = keymatrix[row];
|
||||
#endif
|
||||
return retval;
|
||||
|
@ -878,88 +750,29 @@ void emu_InitJoysticks(void) {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if (defined(PICOMPUTER) || defined(PICOZX) )
|
||||
// keyboard LED
|
||||
#ifdef KLED
|
||||
gpio_init(KLED);
|
||||
gpio_set_dir(KLED, GPIO_OUT);
|
||||
gpio_put(KLED, 1);
|
||||
#endif
|
||||
// Output (rows)
|
||||
gpio_init(KCOLOUT1);
|
||||
gpio_init(KCOLOUT2);
|
||||
gpio_init(KCOLOUT3);
|
||||
gpio_init(KCOLOUT4);
|
||||
gpio_init(KCOLOUT5);
|
||||
gpio_init(KCOLOUT6);
|
||||
#ifdef PICOZX
|
||||
gpio_init(KCOLOUT7);
|
||||
#endif
|
||||
gpio_set_dir(KCOLOUT1, GPIO_OUT);
|
||||
gpio_set_dir(KCOLOUT2, GPIO_OUT);
|
||||
gpio_set_dir(KCOLOUT3, GPIO_OUT);
|
||||
gpio_set_dir(KCOLOUT4, GPIO_OUT);
|
||||
gpio_set_dir(KCOLOUT5, GPIO_OUT);
|
||||
gpio_set_dir(KCOLOUT6, GPIO_OUT);
|
||||
#ifdef PICOZX
|
||||
gpio_set_dir(KCOLOUT7, GPIO_OUT);
|
||||
#endif
|
||||
gpio_put(KCOLOUT1, 1);
|
||||
gpio_put(KCOLOUT2, 1);
|
||||
gpio_put(KCOLOUT3, 1);
|
||||
gpio_put(KCOLOUT4, 1);
|
||||
gpio_put(KCOLOUT5, 1);
|
||||
gpio_put(KCOLOUT6, 1);
|
||||
#ifdef PICOZX
|
||||
gpio_put(KCOLOUT7, 1);
|
||||
#endif
|
||||
// but set as input floating when not used!
|
||||
gpio_set_dir(KCOLOUT1, GPIO_IN);
|
||||
gpio_set_dir(KCOLOUT2, GPIO_IN);
|
||||
gpio_set_dir(KCOLOUT3, GPIO_IN);
|
||||
gpio_set_dir(KCOLOUT4, GPIO_IN);
|
||||
gpio_set_dir(KCOLOUT5, GPIO_IN);
|
||||
gpio_set_dir(KCOLOUT6, GPIO_IN);
|
||||
#ifdef PICOZX
|
||||
gpio_set_dir(KCOLOUT7, GPIO_IN);
|
||||
#endif
|
||||
gpio_disable_pulls(KCOLOUT1);
|
||||
gpio_disable_pulls(KCOLOUT2);
|
||||
gpio_disable_pulls(KCOLOUT3);
|
||||
gpio_disable_pulls(KCOLOUT4);
|
||||
gpio_disable_pulls(KCOLOUT5);
|
||||
gpio_disable_pulls(KCOLOUT6);
|
||||
#ifdef PICOZX
|
||||
gpio_disable_pulls(KCOLOUT7);
|
||||
#endif
|
||||
// Input pins (cols)
|
||||
gpio_init(KROWIN1);
|
||||
gpio_init(KROWIN2);
|
||||
gpio_init(KROWIN3);
|
||||
gpio_init(KROWIN4);
|
||||
gpio_init(KROWIN5);
|
||||
gpio_init(KROWIN6);
|
||||
#ifdef PICOZX
|
||||
gpio_init(KROWIN7);
|
||||
#endif
|
||||
gpio_set_dir(KROWIN1,GPIO_IN);
|
||||
gpio_set_dir(KROWIN2,GPIO_IN);
|
||||
gpio_set_dir(KROWIN3,GPIO_IN);
|
||||
gpio_set_dir(KROWIN4,GPIO_IN);
|
||||
gpio_set_dir(KROWIN5,GPIO_IN);
|
||||
gpio_set_dir(KROWIN6,GPIO_IN);
|
||||
#ifdef PICOZX
|
||||
gpio_set_dir(KROWIN7,GPIO_IN);
|
||||
#endif
|
||||
gpio_pull_up(KROWIN1);
|
||||
gpio_pull_up(KROWIN2);
|
||||
gpio_pull_up(KROWIN3);
|
||||
gpio_pull_up(KROWIN4);
|
||||
gpio_pull_up(KROWIN5);
|
||||
gpio_pull_up(KROWIN6);
|
||||
#ifdef PICOZX
|
||||
gpio_pull_up(KROWIN7);
|
||||
#endif
|
||||
#if ( defined(PICO2ZX) )
|
||||
gpio_init(RP_DAT);
|
||||
gpio_set_dir(RP_DAT, GPIO_OUT);
|
||||
gpio_init(RP_CLK);
|
||||
gpio_set_dir(RP_CLK, GPIO_OUT);
|
||||
gpio_put(RP_DAT, 1);
|
||||
gpio_put(RP_CLK, 0);
|
||||
sleep_ms(1);
|
||||
for(int i = 0; i < CN; i++) {
|
||||
gpio_put(RP_CLK, 1);
|
||||
sleep_ms(1);
|
||||
gpio_put(RP_CLK, 0);
|
||||
sleep_ms(1);
|
||||
}
|
||||
gpio_put(RP_DAT, 0);
|
||||
sleep_ms(1);
|
||||
gpio_put(RP_CLK, 1);
|
||||
sleep_ms(1);
|
||||
for(int i = 0; i < RN; ++i) {
|
||||
gpio_init(rows[i]);
|
||||
gpio_set_dir(rows[i], GPIO_IN);
|
||||
gpio_pull_up(rows[i]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1051,7 +864,7 @@ int handleMenu(uint16_t bClick)
|
|||
return (ACTION_RUN);
|
||||
}
|
||||
|
||||
if ( (bClick & MASK_JOY2_BTN) || (bClick & MASK_KEY_USER1) || (bClick & MASK_KEY_USER4) ) {
|
||||
if ( (bClick & MASK_JOY2_BTN) || (bClick & MASK_KEY_USER1) || (bClick & MASK_KEY_USER3) ) {
|
||||
char newpath[MAX_FILENAME_PATH];
|
||||
strcpy(newpath, selection);
|
||||
strcat(newpath, "/");
|
||||
|
@ -1069,20 +882,15 @@ int handleMenu(uint16_t bClick)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef PICOMPUTER
|
||||
if (key_alt) {
|
||||
emu_writeConfig();
|
||||
}
|
||||
#endif
|
||||
#ifdef PICOZX
|
||||
if (bClick & MASK_KEY_USER4) {
|
||||
#ifdef PICO2ZX
|
||||
if (bClick & MASK_KEY_USER3) {
|
||||
emu_writeConfig();
|
||||
}
|
||||
#endif
|
||||
menuLeft();
|
||||
toggleMenu(false);
|
||||
menuRedraw=false;
|
||||
#ifdef PICOZX
|
||||
#ifdef PICO2ZX
|
||||
if ( tft.getMode() != MODE_VGA_320x240) {
|
||||
if ( (bClick & MASK_KEY_USER1) ) {
|
||||
tft.begin(MODE_VGA_320x240);
|
||||
|
@ -1445,11 +1253,13 @@ void emu_init(void)
|
|||
|
||||
#ifdef HAS_USBHOST
|
||||
printf("Init USB...\n");
|
||||
printf("USB D+/D- on GP%d and GP%d\r\n", PIO_USB_DP_PIN_DEFAULT, PIO_USB_DP_PIN_DEFAULT+1);
|
||||
printf("TinyUSB Host HID Controller Example\r\n");
|
||||
tuh_init(BOARD_TUH_RHPORT);
|
||||
#endif
|
||||
|
||||
#ifdef HAS_USBPIO
|
||||
printf("USB D+/D- on GP%d and GP%d\r\n", PIO_USB_DP_PIN_DEFAULT, PIO_USB_DP_PIN_DEFAULT+1);
|
||||
printf("TinyUSB Host HID Controller Example\r\n");
|
||||
#endif
|
||||
|
||||
#ifdef FILEBROWSER
|
||||
// sd_init_driver();
|
||||
|
||||
|
@ -1490,7 +1300,7 @@ int keypressed = emu_ReadKeys();
|
|||
tft.begin(MODE_VGA_320x240);
|
||||
#else
|
||||
|
||||
#ifdef PICOZX
|
||||
#ifdef PICO2ZX
|
||||
// Force VGA if LEFT/RIGHT pressed
|
||||
if (keypressed & MASK_JOY2_UP)
|
||||
{
|
||||
|
@ -1516,27 +1326,13 @@ int keypressed = emu_ReadKeys();
|
|||
tft.begin(MODE_TFT_320x240);
|
||||
}
|
||||
}
|
||||
#else /* end PICOZX */
|
||||
#else /* end PICO2ZX */
|
||||
tft.begin(MODE_TFT_320x240);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef USE_VGA
|
||||
#ifdef PICOMPUTER
|
||||
// Flip screen if UP pressed
|
||||
if (keypressed & MASK_JOY2_UP)
|
||||
{
|
||||
tft.flipscreen(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
tft.flipscreen(false);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (keypressed & MASK_JOY2_DOWN) {
|
||||
if ( (keypressed & MASK_JOY2_DOWN) ){
|
||||
tft.fillScreenNoDma( RGBVAL16(0xff,0x00,0x00) );
|
||||
tft.drawTextNoDma(64,48, (char*)" AUTURUN file erased", RGBVAL16(0xff,0xff,0x00), RGBVAL16(0xff,0x00,0x00), true);
|
||||
tft.drawTextNoDma(64,48+24, (char*)"Please reset the board!", RGBVAL16(0xff,0xff,0x00), RGBVAL16(0xff,0x00,0x00), true);
|
||||
|
|
|
@ -337,30 +337,29 @@ void hdmi_framebuffer(hdmi_framebuffer_obj_t *self, uint16_t width, uint16_t hei
|
|||
// 250 Mbps, which is very close to the bit clock for 480p 60Hz (252 MHz).
|
||||
// If we want the exact rate then we'll have to reconfigure PLLs.
|
||||
|
||||
|
||||
// Assign clock pair to two neighbouring pins:
|
||||
hstx_ctrl_hw->bit[2] = HSTX_CTRL_BIT0_CLK_BITS;
|
||||
hstx_ctrl_hw->bit[3] = HSTX_CTRL_BIT0_CLK_BITS | HSTX_CTRL_BIT0_INV_BITS;
|
||||
for (uint lane = 0; lane < 3; ++lane) {
|
||||
// For each TMDS lane, assign it to the correct GPIO pair based on the
|
||||
// desired pinout:
|
||||
static const int lane_to_output_bit[3] = {0, 6, 4};
|
||||
int bit = lane_to_output_bit[lane];
|
||||
// Output even bits during first half of each HSTX cycle, and odd bits
|
||||
// during second half. The shifter advances by two bits each cycle.
|
||||
uint32_t lane_data_sel_bits =
|
||||
(lane * 10 ) << HSTX_CTRL_BIT0_SEL_P_LSB |
|
||||
(lane * 10 + 1) << HSTX_CTRL_BIT0_SEL_N_LSB;
|
||||
// The two halves of each pair get identical data, but one pin is inverted.
|
||||
hstx_ctrl_hw->bit[bit ] = lane_data_sel_bits;
|
||||
hstx_ctrl_hw->bit[bit + 1] = lane_data_sel_bits | HSTX_CTRL_BIT0_INV_BITS;
|
||||
}
|
||||
|
||||
hstx_ctrl_hw->bit[HDMI_CLK_PLUS] = HSTX_CTRL_BIT0_CLK_BITS;
|
||||
hstx_ctrl_hw->bit[HDMI_CLK_MINUS] = HSTX_CTRL_BIT0_CLK_BITS | HSTX_CTRL_BIT0_INV_BITS;
|
||||
uint32_t lane_data_sel_bits;
|
||||
// lane 0
|
||||
lane_data_sel_bits = (0 * 10 ) << HSTX_CTRL_BIT0_SEL_P_LSB |
|
||||
(0 * 10 + 1) << HSTX_CTRL_BIT0_SEL_N_LSB;
|
||||
hstx_ctrl_hw->bit[HDMI_D0_PLUS] = lane_data_sel_bits;
|
||||
hstx_ctrl_hw->bit[HDMI_D0_MINUS] = lane_data_sel_bits | HSTX_CTRL_BIT0_INV_BITS;
|
||||
// lane 1
|
||||
lane_data_sel_bits = (1 * 10 ) << HSTX_CTRL_BIT0_SEL_P_LSB |
|
||||
(1 * 10 + 1) << HSTX_CTRL_BIT0_SEL_N_LSB;
|
||||
hstx_ctrl_hw->bit[HDMI_D1_PLUS] = lane_data_sel_bits;
|
||||
hstx_ctrl_hw->bit[HDMI_D1_MINUS] = lane_data_sel_bits | HSTX_CTRL_BIT0_INV_BITS;
|
||||
// lane 2
|
||||
lane_data_sel_bits = (2 * 10 ) << HSTX_CTRL_BIT0_SEL_P_LSB |
|
||||
(2 * 10 + 1) << HSTX_CTRL_BIT0_SEL_N_LSB;
|
||||
hstx_ctrl_hw->bit[HDMI_D2_PLUS] = lane_data_sel_bits;
|
||||
hstx_ctrl_hw->bit[HDMI_D2_MINUS] = lane_data_sel_bits | HSTX_CTRL_BIT0_INV_BITS;
|
||||
for (int i = 12; i <= 19; ++i) {
|
||||
gpio_set_function(i, (gpio_function_t)0); // HSTX
|
||||
}
|
||||
|
||||
|
||||
dma_channel_config c;
|
||||
c = dma_channel_get_default_config(self->dma_command_channel);
|
||||
channel_config_set_transfer_data_size(&c, DMA_SIZE_32);
|
||||
|
|
|
@ -19,76 +19,40 @@
|
|||
#define emu_Input(x) { v20_Input(x); }
|
||||
|
||||
#ifdef KEYMAP_PRESENT
|
||||
|
||||
#ifdef PICOZX
|
||||
|
||||
#ifdef PICO2ZX
|
||||
const unsigned short key_map1[] = {
|
||||
'1','2','3','4','5','6','7','8','9','0',
|
||||
'1','2','3','4','5','6','7','8','9','0',0,
|
||||
'Q','W','E','R','T','Y','U','I','O','P',
|
||||
'A','S','D','F','G','H','J','K','L',0x0D,
|
||||
0,'Z','X','C','V','B','N','M',0,' ',
|
||||
0,0,0,0,150,152 // L R
|
||||
0,0,0,0,127,0 // L R
|
||||
};
|
||||
|
||||
const unsigned short key_map2[] = {
|
||||
'!','@','#','$','%','&','\'','(',')','_',
|
||||
'!','@','#','$','%','&','\'','(',')','_',127,
|
||||
0,0,0,'<','>',0,0,0,';','"',
|
||||
0,0,0,0,0,'^','-','+','=',0x0D,
|
||||
0,':',0,'?','\/','*',',','.',0,' ',
|
||||
153,151,150,152,150,152 //U L R D L R
|
||||
153,151,150,152,0,0 //U L R D
|
||||
};
|
||||
|
||||
const unsigned short key_map3[] = {
|
||||
133,134,135,136,137,138,139,140,0,0, // function keys
|
||||
129,130,131,132,133,134,135,136,0,0,0, // function keys
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
153,151,150,152,150,152 //U L R D L R
|
||||
153,151,150,152,0,0 //U L R D
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x104,0x101,0x108,0x102,0x110,0x120,0x140,0x204,0x201,0x208, // row 1
|
||||
0x202,0x210,0x220,0x240,0x304,0x301,0x308,0x302,0x310,0x320, // row 2
|
||||
0x340,0x404,0x401,0x408,0x402,0x410,0x420,0x440,0x504,0x501, // row 3
|
||||
0x020,0x508,0x502,0x510,0x520,0x540,0x604,0x601,0x040,0x608, // row 4
|
||||
0x008,0x001,0x002,0x010,0x620,0x640 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
|
||||
#else
|
||||
#define keylables_map1_0 (char *)"qwertyuiop\x1a"
|
||||
#define keylables_map1_1 (char *)" asdfghjkl\x19"
|
||||
#define keylables_map1_2 (char *)" zxcvbnm.\x10 "
|
||||
const unsigned short key_map1[] = {
|
||||
'Q','W','E','R','T','Y','U','I','O','P',157,
|
||||
0,'A','S','D','F','G','H','J','K','L',0x0D,
|
||||
0,'Z','X','C','V','B','N','M','.',' ',
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
#define keylables_map2_0 (char *)"1234567890 "
|
||||
#define keylables_map2_1 (char *)" !@#$%+&*- "
|
||||
#define keylables_map2_2 (char *)" ()?/\"<>,: "
|
||||
const unsigned short key_map2[] = {
|
||||
'1','2','3','4','5','6','7','8','9','0',0,
|
||||
0, '!','@','#','$','%','+','&','*','-','\/',
|
||||
0, '(',')','?','\/','"','<','>',',',':',
|
||||
145,157,29,17 //U L R D
|
||||
};
|
||||
|
||||
#define keylables_map3_0 (char *)"\x11\x12\x13\x14\x15\x16\x17\x18 "
|
||||
#define keylables_map3_1 (char *)" "
|
||||
#define keylables_map3_2 (char *)" ;= "
|
||||
const unsigned short key_map3[] = {
|
||||
133,134,135,136,137,138,139,140,0,0,0, // function keys
|
||||
0, 0,0,0,0,0,0,0,0,0,0,
|
||||
0, 0,0,0,0,0,0,0,';','=',
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x020,0x120,0x220,0x320,0x420,0x408,0x308,0x208,0x108,0x008,0x002, // row 1
|
||||
0x510,0x010,0x110,0x210,0x310,0x410,0x401,0x301,0x201,0x101,0x001, // row 2
|
||||
0x520,0x102,0x202,0x302,0x402,0x404,0x304,0x204,0x104,0x004, // row 3
|
||||
0x508,0x501,0x502,0x504 }; // cursor keys
|
||||
#endif
|
||||
0x401,0x301,0x201,0x101,0x001,0x008,0x108,0x208,0x308,0x408,0x580, // row 1
|
||||
0x402,0x302,0x202,0x102,0x002,0x010,0x110,0x210,0x310,0x410, // row 2
|
||||
0x404,0x304,0x204,0x104,0x004,0x040,0x140,0x240,0x340,0x440, // row 3
|
||||
0x420,0x320,0x220,0x120,0x020,0x080,0x180,0x280,0x380,0x480, // row 4
|
||||
0x520,0x540,0x510,0x508,0x502,0x504 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -71,7 +71,7 @@ int main(void) {
|
|||
emu_Init(filename);
|
||||
tft.startRefresh();
|
||||
struct repeating_timer timer;
|
||||
add_repeating_timer_ms(15, repeating_timer_callback, NULL, &timer);
|
||||
add_repeating_timer_ms(25, repeating_timer_callback, NULL, &timer);
|
||||
while (true) {
|
||||
//uint16_t bClick = emu_DebounceLocalKeys();
|
||||
//emu_Input(bClick);
|
||||
|
|
|
@ -2,5 +2,6 @@
|
|||
#define _PROGRAM_CONFIG_H_
|
||||
|
||||
#define KEYBOARD_ACTIVATED 1
|
||||
//#undef HAS_SND
|
||||
|
||||
#endif
|
||||
|
|
|
@ -78,10 +78,9 @@ static void VIC_VOICE_HANDLE(int voice, int value, int shift)
|
|||
|
||||
|
||||
void SND_Process(void * stream, int len) {
|
||||
unsigned short * dstbuffer = (unsigned short *)stream;
|
||||
int o0, o1, o2, o3;
|
||||
|
||||
short * sndbuf = (short *)stream;
|
||||
for (int i = 0; i < len/2; i++)
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
/* addfptrs */
|
||||
psid.v[0].f += psid.v[0].fs;
|
||||
|
@ -96,10 +95,9 @@ void SND_Process(void * stream, int len) {
|
|||
o1 = (psid.v[1].f & 0x80000000) >> 2;
|
||||
o2 = (psid.v[2].f & 0x80000000) >> 2;
|
||||
o3 = (int)NVALUE(NSHIFT(psid.v[3].rv, psid.v[3].f >> 28)) << 22;
|
||||
/* sample */
|
||||
uint16_t s = ((int)((o0+o1+o2+o3)>>20)-0x800)*psid.vol;
|
||||
*sndbuf++ =s;
|
||||
*sndbuf++ =s;
|
||||
uint16_t s = (((o0+o1+o2+o3)>>(16+10))*psid.vol)>>4;
|
||||
//int s = ((int)((o0+o1+o2+o3)>>20)-0x800)*psid.vol;
|
||||
*dstbuffer++ =s;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,10 +252,17 @@ void v20_Init(void)
|
|||
// load kernal rom
|
||||
for(int i=0; i<8192; i++) {
|
||||
vicmemory[0xE000+i] = kernalrom[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void v20_Start(char * filename)
|
||||
{
|
||||
loadROM(filename,0);
|
||||
|
||||
#ifdef HAS_SND
|
||||
emu_sndInit();
|
||||
psid.speed1 = (1000000 << 8) / 22000;
|
||||
psid.v[3].rv = NSEED;
|
||||
for (int i = 0; i < NOISETABLESIZE; i++)
|
||||
|
@ -267,15 +272,7 @@ void v20_Init(void)
|
|||
noiseMSB[i] = (((i<<(7-(22-16)))&0x80)|((i<<(6-(20-16)))&0x40)
|
||||
|((i<<(5-(16-16)))&0x20));
|
||||
}
|
||||
emu_sndInit();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
void v20_Start(char * filename)
|
||||
{
|
||||
loadROM(filename,0);
|
||||
#endif
|
||||
|
||||
// Reset cpu
|
||||
mos.Reset();
|
||||
|
@ -348,7 +345,7 @@ void v20_Step(void)
|
|||
int hk=ihk;
|
||||
if (iusbhk) hk = iusbhk;
|
||||
|
||||
#if (defined(PICOMPUTER) || defined(PICOZX) || defined(PICOHYPERPET) )
|
||||
#if (defined(PICO2ZX) || defined(PICOHYPERPET) )
|
||||
if (hk) {
|
||||
int scan = ascii2scan[hk];
|
||||
if (scan & 0x10000) mos6522.setShiftPressed(true);
|
||||
|
@ -363,7 +360,7 @@ void v20_Step(void)
|
|||
|
||||
|
||||
int k=ik;
|
||||
#if (defined(PICOMPUTER) || defined(PICOZX) || defined(PICOHYPERPET) )
|
||||
#if (defined(PICO2ZX) || defined(PICOHYPERPET) )
|
||||
// Ignore joypad if shift is pressed!!!
|
||||
// if ( !(k & MASK_KEY_USER2) )
|
||||
if ( hk == 0 )
|
||||
|
@ -401,7 +398,7 @@ void v20_Step(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if (defined(PICOMPUTER) || defined(PICOZX) || defined(PICOHYPERPET))
|
||||
#if (defined(PICO2ZX) || defined(PICOHYPERPET))
|
||||
#else
|
||||
if ( !(pik & MASK_KEY_USER1) && (k & MASK_KEY_USER1) ) {
|
||||
mos6522.setKeyPressed(0xEF7F);
|
||||
|
|
|
@ -20,75 +20,39 @@
|
|||
|
||||
#ifdef KEYMAP_PRESENT
|
||||
|
||||
#ifdef PICOZX
|
||||
#ifdef PICO2ZX
|
||||
const unsigned short key_map1[] = {
|
||||
'1','2','3','4','5','6','7','8','9','0',
|
||||
'1','2','3','4','5','6','7','8','9','0',127,
|
||||
'Q','W','E','R','T','Y','U','I','O','P',
|
||||
'A','S','D','F','G','H','J','K','L',0x0D,
|
||||
0,'Z','X','C','V','B','N','M',0,' ',
|
||||
0,0,0,0,150,152 // L R
|
||||
0,0,0,0,127,0 // L R
|
||||
};
|
||||
|
||||
const unsigned short key_map2[] = {
|
||||
'!','@','#','$','%','&','\'','(',')','_',
|
||||
'!','@','#','$','%','&','\'','(',')','_',127,
|
||||
0,0,0,'<','>',0,0,0,';','"',
|
||||
0,0,0,0,0,'^','-','+','=',0x0D,
|
||||
0,':',0,'?','\/','*',',','.',0,' ',
|
||||
153,151,150,152, //U L R D
|
||||
153,151,150,152,0,0 //U L R D
|
||||
};
|
||||
|
||||
const unsigned short key_map3[] = {
|
||||
133,134,135,136,137,138,139,140,0,0, // function keys
|
||||
129,130,131,132,133,134,135,136,0,0,0, // function keys
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
153,151,150,152, //U L R D
|
||||
153,151,150,152,0,0 //U L R D
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x104,0x101,0x108,0x102,0x110,0x120,0x140,0x204,0x201,0x208, // row 1
|
||||
0x202,0x210,0x220,0x240,0x304,0x301,0x308,0x302,0x310,0x320, // row 2
|
||||
0x340,0x404,0x401,0x408,0x402,0x410,0x420,0x440,0x504,0x501, // row 3
|
||||
0x020,0x508,0x502,0x510,0x520,0x540,0x604,0x601,0x040,0x608, // row 4
|
||||
0x008,0x001,0x002,0x010,0x620,0x640 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
|
||||
#else
|
||||
#define keylables_map1_0 (char *)"qwertyuiop\x1a"
|
||||
#define keylables_map1_1 (char *)" asdfghjkl\x19"
|
||||
#define keylables_map1_2 (char *)" zxcvbnm.\x10 "
|
||||
const unsigned short key_map1[] = {
|
||||
'Q','W','E','R','T','Y','U','I','O','P',157,
|
||||
0,'A','S','D','F','G','H','J','K','L',0x0D,
|
||||
0,'Z','X','C','V','B','N','M','.',' ',
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
#define keylables_map2_0 (char *)"1234567890 "
|
||||
#define keylables_map2_1 (char *)" !@#$%+&*- "
|
||||
#define keylables_map2_2 (char *)" ()?/\"<>,: "
|
||||
const unsigned short key_map2[] = {
|
||||
'1','2','3','4','5','6','7','8','9','0',0,
|
||||
0, '!','@','#','$','%','+','&','*','-','\/',
|
||||
0, '(',')','?','\/','"','<','>',',',':',
|
||||
145,157,29,17 //U L R D
|
||||
};
|
||||
|
||||
#define keylables_map3_0 (char *)"\x11\x12\x13\x14\x15\x16\x17\x18 "
|
||||
#define keylables_map3_1 (char *)" "
|
||||
#define keylables_map3_2 (char *)" ;= "
|
||||
const unsigned short key_map3[] = {
|
||||
133,134,135,136,137,138,139,140,0,0,0, // function keys
|
||||
0, 0,0,0,0,0,0,0,0,0,0,
|
||||
0, 0,0,0,0,0,0,0,';','=',
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x020,0x120,0x220,0x320,0x420,0x408,0x308,0x208,0x108,0x008,0x002, // row 1
|
||||
0x510,0x010,0x110,0x210,0x310,0x410,0x401,0x301,0x201,0x101,0x001, // row 2
|
||||
0x520,0x102,0x202,0x302,0x402,0x404,0x304,0x204,0x104,0x004, // row 3
|
||||
0x508,0x501,0x502,0x504 }; // cursor keys
|
||||
#endif
|
||||
0x401,0x301,0x201,0x101,0x001,0x008,0x108,0x208,0x308,0x408,0x580, // row 1
|
||||
0x402,0x302,0x202,0x102,0x002,0x010,0x110,0x210,0x310,0x410, // row 2
|
||||
0x404,0x304,0x204,0x104,0x004,0x040,0x140,0x240,0x340,0x440, // row 3
|
||||
0x420,0x320,0x220,0x120,0x020,0x080,0x180,0x280,0x380,0x480, // row 4
|
||||
0x520,0x540,0x510,0x508,0x502,0x504 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,5 +2,6 @@
|
|||
#define _PROGRAM_CONFIG_H_
|
||||
|
||||
#define KEYBOARD_ACTIVATED 1
|
||||
#undef HAS_SND
|
||||
|
||||
#endif
|
||||
|
|
|
@ -497,6 +497,7 @@ void mode1 (tpixel *p, const tpixel *pe, uint16_t *spl, const uint16_t vc) {
|
|||
|
||||
/*****************************************************************************************************/
|
||||
void mode2 (tpixel *p, const tpixel *pe, uint16_t *spl, const uint16_t vc) {
|
||||
|
||||
/*
|
||||
Standard-Bitmap-Modus (ECM / BMM / MCM = 0/1/0) ("HIRES")
|
||||
In diesem Modus (wie in allen Bitmap-Modi) liest der VIC die Grafikdaten aus einer 320×200-Bitmap,
|
||||
|
@ -626,6 +627,7 @@ void mode2 (tpixel *p, const tpixel *pe, uint16_t *spl, const uint16_t vc) {
|
|||
}
|
||||
/*****************************************************************************************************/
|
||||
void mode3 (tpixel *p, const tpixel *pe, uint16_t *spl, const uint16_t vc) {
|
||||
|
||||
/*
|
||||
Multicolor-Bitmap-Modus (ECM/BMM/MCM=0/1/1)
|
||||
|
||||
|
@ -783,6 +785,7 @@ void mode3 (tpixel *p, const tpixel *pe, uint16_t *spl, const uint16_t vc) {
|
|||
}
|
||||
/*****************************************************************************************************/
|
||||
void mode4 (tpixel *p, const tpixel *pe, uint16_t *spl, const uint16_t vc) {
|
||||
|
||||
//ECM-Textmodus (ECM/BMM/MCM=1/0/0)
|
||||
/*
|
||||
Dieser Textmodus entspricht dem Standard-Textmodus, erlaubt es aber, für
|
||||
|
@ -901,6 +904,7 @@ void mode4 (tpixel *p, const tpixel *pe, uint16_t *spl, const uint16_t vc) {
|
|||
/*****************************************************************************************************/
|
||||
|
||||
void mode5 (tpixel *p, const tpixel *pe, uint16_t *spl, const uint16_t vc) {
|
||||
|
||||
/*
|
||||
Ungültiger Textmodus (ECM/BMM/MCM=1/0/1)
|
||||
|
||||
|
@ -1155,6 +1159,7 @@ void mode6 (tpixel *p, const tpixel *pe, uint16_t *spl, const uint16_t vc) {
|
|||
}
|
||||
/*****************************************************************************************************/
|
||||
void mode7 (tpixel *p, const tpixel *pe, uint16_t *spl, const uint16_t vc) {
|
||||
|
||||
/*
|
||||
Ungültiger Bitmap-Modus 2 (ECM/BMM/MCM=1/1/1)
|
||||
|
||||
|
@ -1272,7 +1277,7 @@ typedef void (*modes_t)( tpixel *p, const tpixel *pe, uint16_t *spl, const uint1
|
|||
const modes_t modes[8] = {mode0, mode1, mode2, mode3, mode4, mode5, mode6, mode7};
|
||||
|
||||
|
||||
static tpixel linebuffer[SCREEN_WIDTH*2];
|
||||
static tpixel linebuffer[SCREEN_WIDTH*3];
|
||||
|
||||
void vic_do(void) {
|
||||
|
||||
|
@ -1393,7 +1398,7 @@ void vic_do(void) {
|
|||
}
|
||||
|
||||
//max_x = (!cpu.vic.CSEL) ? 40:38;
|
||||
p = &linebuffer[0];
|
||||
p = &linebuffer[SCREEN_WIDTH+0];
|
||||
pe = p + SCREEN_WIDTH;
|
||||
//Left Screenborder: Cycle 10
|
||||
spl = &cpu.vic.spriteLine[24];
|
||||
|
@ -1401,7 +1406,7 @@ void vic_do(void) {
|
|||
|
||||
|
||||
if (cpu.vic.borderFlag) {
|
||||
cpu_clock(5);
|
||||
cpu_clock(5);
|
||||
fastFillLineNoSprites(p, pe + BORDER_RIGHT, cpu.vic.colors[0]);
|
||||
goto noDisplayIncRC ;
|
||||
}
|
||||
|
@ -1528,12 +1533,12 @@ g-Zugriff
|
|||
| "11": Schwarz (Vordergrund) |
|
||||
+---------------------------------------+
|
||||
*/
|
||||
//Modes 1 & 3
|
||||
//Modes 1 & 3
|
||||
if (mode == 1 || mode == 3) {
|
||||
modes[mode](p, pe, spl, vc);
|
||||
modes[mode](p, pe, spl, vc);
|
||||
} else {//TODO: all other modes
|
||||
fastFillLine(p, pe, cpu.vic.palette[0], spl);
|
||||
}
|
||||
fastFillLine(p, pe, cpu.vic.palette[0], spl);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1556,7 +1561,7 @@ g-Zugriff
|
|||
if (!cpu.vic.CSEL) {
|
||||
cpu_clock(1);
|
||||
uint16_t col = cpu.vic.colors[0];
|
||||
p = &linebuffer[0]; // tft.getLineBuffer((r - FIRSTDISPLAYLINE));
|
||||
p = &linebuffer[SCREEN_WIDTH+0]; // tft.getLineBuffer((r - FIRSTDISPLAYLINE));
|
||||
#if 0
|
||||
// Sprites im Rand
|
||||
uint16_t sprite;
|
||||
|
@ -1578,7 +1583,7 @@ g-Zugriff
|
|||
#endif
|
||||
|
||||
//Rand rechts:
|
||||
p = &linebuffer[SCREEN_WIDTH - 9 + BORDER_LEFT]; //tft.getLineBuffer((r - FIRSTDISPLAYLINE)) + SCREEN_WIDTH - 9 + BORDER_LEFT;
|
||||
p = &linebuffer[SCREEN_WIDTH+SCREEN_WIDTH - 9 + BORDER_LEFT]; //tft.getLineBuffer((r - FIRSTDISPLAYLINE)) + SCREEN_WIDTH - 9 + BORDER_LEFT;
|
||||
pe = p + 9;
|
||||
|
||||
#if 0
|
||||
|
@ -1598,8 +1603,9 @@ g-Zugriff
|
|||
|
||||
}
|
||||
|
||||
emu_DrawLine16(&linebuffer[0], SCREEN_WIDTH, SCREEN_HEIGHT, (r - FIRSTDISPLAYLINE));
|
||||
memset(&linebuffer[0],0,SCREEN_WIDTH*2);
|
||||
if ( ( (r - FIRSTDISPLAYLINE) < 240 ) && ( (r - FIRSTDISPLAYLINE) >= 0 ) )
|
||||
emu_DrawLine16(&linebuffer[SCREEN_WIDTH], SCREEN_WIDTH, SCREEN_HEIGHT, (r - FIRSTDISPLAYLINE));
|
||||
memset(&linebuffer[0],0,SCREEN_WIDTH*3);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "pia.h"
|
||||
#include "colours.h"
|
||||
#include "emuapi.h"
|
||||
#if HAS_SND
|
||||
#ifdef HAS_SND
|
||||
#include "pokeysnd.h"
|
||||
#endif
|
||||
#include "kbd.h"
|
||||
|
@ -292,7 +292,7 @@ const unsigned char keyboardAsciiConv[] = // Ascii to ATARI keys
|
|||
/* 0x27 */ INV_KEY, // ' singlequote
|
||||
/* 0x28 */ 112, // ( bracket left
|
||||
/* 0x29 */ 114, // ) bracket right
|
||||
/* 0x2A */ 0x0E, // * mult
|
||||
/* 0x2A */ 0x07, // * mult
|
||||
/* 0x2B */ 0x06, // + plus
|
||||
/* 0x2C */ 0x20, // , comma
|
||||
/* 0x2D */ 0x0E, // - minus
|
||||
|
@ -453,7 +453,7 @@ void at8_Init(void)
|
|||
emu_SetPaletteEntry(R32(colourtable[i]), G32(colourtable[i]), B32(colourtable[i]), i);
|
||||
}
|
||||
|
||||
#if HAS_SND
|
||||
#ifdef HAS_SND
|
||||
emu_sndInit();
|
||||
POKEYSND_Init(POKEYSND_FREQ_17_APPROX, 44100, 1, POKEYSND_BIT16);
|
||||
#endif
|
||||
|
|
|
@ -21,77 +21,37 @@
|
|||
|
||||
#ifdef KEYMAP_PRESENT
|
||||
|
||||
#ifdef PICOZX
|
||||
#ifdef PICO2ZX
|
||||
const unsigned short key_map1[] = {
|
||||
0x1F+1,0x1F,0x1A+1,0x18+1,0x1D+1,0x1B+1,0x33+1,0x35+1,0x30+1,0x32+1,
|
||||
0x2F+1,0x2F,0x2A+1,0x28+1,0x2D+1,0x2B+1,0x0B+1,0x0D+1,0x08+1,0x0A+1,
|
||||
0x3F+1,0x3F,0x3A+1,0x38+1,0x3D+1,0x39+1,0x01+1,0x05+1,0x00+1,0x0D,
|
||||
0,0x17+1,0x16+1,0x12+1,0x10+1,0x15+1,0x23+1,0x25+1,0,0x21+1,
|
||||
0,0,0,0,0x34+1,0x87+1 // back R
|
||||
'1','2','3','4','5','6','7','8','9','0',127,
|
||||
'q','w','e','r','t','y','u','i','o','p',
|
||||
'a','s','d','f','g','h','j','k','l',0x0D,
|
||||
0,'z','x','c','v','b','n','m',0,' ',
|
||||
0,0,0,0,127,0 // back
|
||||
};
|
||||
|
||||
const unsigned short key_map2[] = {
|
||||
95+1,117+1,90+1,88+1,93+1,91+1,115+1,112+1,114+1,0,
|
||||
0,0,0,0x36+1,0x37+1,0,0,0,0x02+1,94+1,
|
||||
0,0,0,0,0,0,0x0E + 1,0x06+1,0x0F+1,0x0D,
|
||||
0,66+1,0,102+1,0x26+1,0x07+1,0x20+1,0x22+1,0,' ',
|
||||
0x8e + 1,0x86+1,0x87+1,0x8f+1,0x34+1,0x87+1 //U L R D back R
|
||||
'!','@','#','$','%','&','\'','(',')','_',0,
|
||||
0,0,0,'<','>',0,0,0,';','"',
|
||||
0,0,0,0,0,'^','-','+','=',0x0D,
|
||||
0,':',0,'?','\/','*',',','.',0,' ',
|
||||
0xd7,0xd8,0xd9,0xda,0,0 //U L R D
|
||||
};
|
||||
|
||||
const unsigned short key_map3[] = {
|
||||
3+1,4+1,19+1,20+1,17+1,0,0,0,0,0, // function keys
|
||||
0,0,0,0,0,0,0,0,0,0,0, // function keys
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0x8e + 1,0x86+1,0x87+1,0x8f+1,0x34+1,0x87+1 //U L R D back R
|
||||
0xd7,0xd8,0xd9,0xda,0,0 //U L R D
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x104,0x101,0x108,0x102,0x110,0x120,0x140,0x204,0x201,0x208, // row 1
|
||||
0x202,0x210,0x220,0x240,0x304,0x301,0x308,0x302,0x310,0x320, // row 2
|
||||
0x340,0x404,0x401,0x408,0x402,0x410,0x420,0x440,0x504,0x501, // row 3
|
||||
0x020,0x508,0x502,0x510,0x520,0x540,0x604,0x601,0x040,0x608, // row 4
|
||||
0x008,0x001,0x002,0x010,0x620,0x640 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
|
||||
#else
|
||||
|
||||
#define keylables_map1_0 (char *)"qwertyuiop\x1a"
|
||||
#define keylables_map1_1 (char *)" asdfghjkl\x19"
|
||||
#define keylables_map1_2 (char *)" zxcvbnm.\x10 "
|
||||
const unsigned short key_map1[] = {
|
||||
0x2F+1,0x2F,0x2A+1,0x28+1,0x2D+1,0x2B+1,0x0B+1,0x0D+1,0x08+1,0x0A+1,0x34+1,
|
||||
0,0x3F+1,0x3F,0x3A+1,0x38+1,0x3D+1,0x39+1,0x01+1,0x05+1,0x00+1,0x0C+1,
|
||||
0,0x17+1,0x16+1,0x12+1,0x10+1,0x15+1,0x23+1,0x25+1,0x22+1, 0x21+1,
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
#define keylables_map2_0 (char *)"1234567890="
|
||||
#define keylables_map2_1 (char *)"T!@#$%+&*- "
|
||||
#define keylables_map2_2 (char *)" ()?/\"<>,: "
|
||||
const unsigned short key_map2[] = {
|
||||
0x1F+1,0x1F,0x1A+1,0x18+1,0x1D+1,0x1B+1,0x33+1,0x35+1,0x30+1,0x32+1,0x0F+1, // Digits
|
||||
0x2C+1,95+1,117+1,90+1,88+1,93+1,0x06+1,91+1,0x07+1,0x0E + 1,0, // various
|
||||
0, 112+1,114+1,102+1,0x26+1,94+1,0x36+1,0x37+1,0x20+1,66+1,
|
||||
0x8e + 1,0x86+1,0x87+1,0x8f+1 //U L R D
|
||||
};
|
||||
//0x07+1=*, 0x22+1=.,0x26+1=/, 0x02+1=;, 0x06+1=+, 0x36+1=<, 0x37+1=>, 0x0F+1==, 0x0E+1=-, 0x06+1=+
|
||||
|
||||
#define keylables_map3_0 (char *)"\x11\x12\x13\x14H "
|
||||
#define keylables_map3_1 (char *)" "
|
||||
#define keylables_map3_2 (char *)" ' ; "
|
||||
const unsigned short key_map3[] = {
|
||||
3+1,4+1,19+1,20+1,17+1,0,0,0,0,0,0, // function keys
|
||||
0, 0,0,0,0,0,0,0,0,0,0,
|
||||
0, 0,0,0,0,115+1,0,0,0x02+1,0,
|
||||
0x8e + 1,0x86+1,0x87+1,0x8f+1 //U L R D
|
||||
};
|
||||
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x020,0x120,0x220,0x320,0x420,0x408,0x308,0x208,0x108,0x008,0x002, // row 1
|
||||
0x510,0x010,0x110,0x210,0x310,0x410,0x401,0x301,0x201,0x101,0x001, // row 2
|
||||
0x520,0x102,0x202,0x302,0x402,0x404,0x304,0x204,0x104,0x004, // row 3
|
||||
0x508,0x501,0x502,0x504 }; // cursor keys
|
||||
0x401,0x301,0x201,0x101,0x001,0x008,0x108,0x208,0x308,0x408,0x580, // row 1
|
||||
0x402,0x302,0x202,0x102,0x002,0x010,0x110,0x210,0x310,0x410, // row 2
|
||||
0x404,0x304,0x204,0x104,0x004,0x040,0x140,0x240,0x340,0x440, // row 3
|
||||
0x420,0x320,0x220,0x120,0x020,0x080,0x180,0x280,0x380,0x480, // row 4
|
||||
0x520,0x540,0x510,0x508,0x502,0x504 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -364,7 +364,15 @@ void POKEYSND_SetMzQuality(int quality) /* specially for win32, perhaps not need
|
|||
|
||||
void SND_Process(void *sndbuffer, int sndn)
|
||||
{
|
||||
POKEYSND_Process_ptr(sndbuffer, sndn);
|
||||
pokeysnd_process_8(sndbuffer, sndn);
|
||||
char *scrbuffer = sndbuffer;
|
||||
short *dstbuffer = sndbuffer;
|
||||
int i;
|
||||
for (i = sndn-1; i >= 0; i--) {
|
||||
short s = scrbuffer[i];
|
||||
dstbuffer[i]=s;
|
||||
}
|
||||
|
||||
#if defined(PBI_XLD) || defined (VOICEBOX)
|
||||
VOTRAXSND_Process(sndbuffer,sndn);
|
||||
#endif
|
||||
|
|
|
@ -64,11 +64,7 @@ extern "C" void write_ram(int address, unsigned char val);
|
|||
extern uint8_t * LORAM;
|
||||
|
||||
void write86(uint32_t addr32, uint8_t value) {
|
||||
if (addr32 < NATIVE_RAM) {
|
||||
LORAM[addr32] = value;
|
||||
return;
|
||||
}
|
||||
else if (addr32 < RAM_SIZE) {
|
||||
if (addr32 < RAM_SIZE) {
|
||||
write_ram(addr32, value);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -13,16 +13,25 @@ uint8_t * LORAM;
|
|||
|
||||
extern void timer_isr(void);
|
||||
|
||||
#ifdef HAS_PSRAM
|
||||
#include "psram_t.h"
|
||||
|
||||
PSRAM_T psram = PSRAM_T(PSRAM_CS, PSRAM_MOSI, PSRAM_SCLK, PSRAM_MISO);
|
||||
#endif
|
||||
|
||||
extern "C" unsigned char read_ram(int address) {
|
||||
return (psram.psread(address));
|
||||
if (address < NATIVE_RAM) return LOMEM[address];
|
||||
#ifdef HAS_PSRAM
|
||||
else
|
||||
return psram.psread(address);
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" void write_ram(int address, unsigned char val) {
|
||||
psram.pswrite(address,val);
|
||||
if (address < NATIVE_RAM) LOMEM[address] = val;
|
||||
#ifdef HAS_PSRAM
|
||||
else
|
||||
psram.pswrite(address,val);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define PALMULT8(x) ((x)<<5)
|
||||
|
@ -504,12 +513,42 @@ extern void apc_Input(int bClick) {
|
|||
|
||||
if (cnt-- < 0) {
|
||||
cnt=5;
|
||||
|
||||
//{
|
||||
hk = emu_ReadI2CKeyboard();
|
||||
k = emu_ReadKeys();
|
||||
switch (hk) {
|
||||
case 0x7F: hk = 0xFF08; break; //backspace
|
||||
case 0x09: hk = 0xFF09; break; //tab
|
||||
case 0x0A: hk = 0xFF0D; break; //enter
|
||||
case 0X1B: hk = 0xFF1B; break; //escape
|
||||
case 0x90: hk = 0xFF63; break; //KP 0 / insert
|
||||
case 0x93: hk = 0xFFFF; break; //KP . / delete
|
||||
case 0x92: hk = 0xFF55; break; //pgup
|
||||
case 0x95: hk = 0xFF56; break; //pgdn
|
||||
case 0x91: hk = 0xFF50; break; //home
|
||||
case 0x94: hk = 0xFF57; break; //end
|
||||
case 0x81: hk = 0xFFBE; break; //F1
|
||||
case 0x82: hk = 0xFFBF; break; //F2
|
||||
case 0x83: hk = 0xFFC0; break; //F3
|
||||
case 0x84: hk = 0xFFC1; break; //F4
|
||||
case 0x85: hk = 0xFFC2; break; //F5
|
||||
case 0x86: hk = 0xFFC3; break; //F6
|
||||
case 0x87: hk = 0xFFC4; break; //F7
|
||||
case 0x88: hk = 0xFFC5; break; //F8
|
||||
case 0x89: hk = 0xFFC6; break; //F9
|
||||
case 0x8A: hk = 0xFFC7; break; //F10
|
||||
case 0x8B: hk = 0xFFC8; break; //F11
|
||||
case 0x8C: hk = 0xFFC9; break; //F12
|
||||
case 0x97: hk = 0xFF51; break; //left
|
||||
case 0x99: hk = 0xFF52; break; //up
|
||||
case 0x96: hk = 0xFF53; break; //right
|
||||
case 0x98: hk = 0xFF54; break; //down
|
||||
}
|
||||
|
||||
|
||||
k = emu_ReadKeys();
|
||||
/*
|
||||
if (nbkeys == 0) {
|
||||
if (bClick & MASK_JOY2_BTN) {
|
||||
if (bClick & MASK_KEY_USER2) {
|
||||
nbkeys = strlen(seq1);
|
||||
seq=seq1;
|
||||
kcnt=0;
|
||||
|
@ -534,6 +573,7 @@ extern void apc_Input(int bClick) {
|
|||
toggle = false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -673,7 +713,9 @@ void apc_Step(void)
|
|||
|
||||
void apc_Init(void)
|
||||
{
|
||||
#ifdef HAS_PSRAM
|
||||
psram.begin();
|
||||
#endif
|
||||
//RAM = (uint8_t*) malloc(RAM_SIZE);
|
||||
//if (!RAM) emu_printf("RAM malloc failed");
|
||||
LORAM = &LOMEM[0];
|
||||
|
|
|
@ -20,83 +20,39 @@
|
|||
|
||||
#ifdef KEYMAP_PRESENT
|
||||
|
||||
#ifdef PICOZX
|
||||
#ifdef PICO2ZX
|
||||
const unsigned short key_map1[] = {
|
||||
2,3,4,5,6,7,8,9,10,1,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0
|
||||
'1','2','3','4','5','6','7','8','9','0',127,
|
||||
'Q','W','E','R','T','Y','U','I','O','P',
|
||||
'A','S','D','F','G','H','J','K','L',0x0A,
|
||||
0,'Z','X','C','V','B','N','M',0,' ',
|
||||
0,0,0,0,127,0 // L R
|
||||
};
|
||||
|
||||
const unsigned short key_map2[] = {
|
||||
0,0,11,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,12,0,0,0,0,
|
||||
0,0,0,0,0,0
|
||||
'!','@','#','$','%','&','\'','(',')','_',0,
|
||||
0,0,0,'<','>',0,0,0,';','"',
|
||||
0,0,0,0,0,'^','-','+','=',0x0A,
|
||||
0,':',0,'?','\/','*',',','.',0,' ',
|
||||
153,151,150,152,0,0 //U L R D
|
||||
};
|
||||
|
||||
const unsigned short key_map3[] = {
|
||||
133,134,135,136,137,138,139,140,0,0,0, // function keys
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0
|
||||
153,151,150,152,0,0 //U L R D
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x104,0x101,0x108,0x102,0x110,0x120,0x140,0x204,0x201,0x208, // row 1
|
||||
0x202,0x210,0x220,0x240,0x304,0x301,0x308,0x302,0x310,0x320, // row 2
|
||||
0x340,0x404,0x401,0x408,0x402,0x410,0x420,0x440,0x504,0x501, // row 3
|
||||
0x020,0x508,0x502,0x510,0x520,0x540,0x604,0x601,0x040,0x608, // row 4
|
||||
0x008,0x001,0x002,0x010,0x620,0x640 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
|
||||
#else
|
||||
#define keylables_map1_0 (char *)"1234567890 "
|
||||
#define keylables_map1_1 (char *)" # * "
|
||||
#define keylables_map1_2 (char *)" "
|
||||
const unsigned short key_map1[] = {
|
||||
2,3,4,5,6,7,8,9,10,1,0,
|
||||
0,0,0,11,0,0,0,0,12,0,0,
|
||||
0, 0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
/*
|
||||
const unsigned short key_map1[] = {
|
||||
2,3,4,
|
||||
5,6,7,
|
||||
8,9,10,
|
||||
11,1,12};
|
||||
*/
|
||||
|
||||
#define keylables_map2_0 (char *)" "
|
||||
#define keylables_map2_1 (char *)" "
|
||||
#define keylables_map2_2 (char *)" "
|
||||
const unsigned short key_map2[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,
|
||||
0, 0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
#define keylables_map3_0 (char *)" "
|
||||
#define keylables_map3_1 (char *)" "
|
||||
#define keylables_map3_2 (char *)" "
|
||||
const unsigned short key_map3[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0, // function keys
|
||||
0, 0,0,0,0,0,0,0,0,0,0,
|
||||
0, 0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x020,0x120,0x220,0x320,0x420,0x408,0x308,0x208,0x108,0x008,0x002, // row 1
|
||||
0x510,0x010,0x110,0x210,0x310,0x410,0x401,0x301,0x201,0x101,0x001, // row 2
|
||||
0x520,0x102,0x202,0x302,0x402,0x404,0x304,0x204,0x104,0x004, // row 3
|
||||
0x508,0x501,0x502,0x504 }; // cursor keys
|
||||
#endif
|
||||
0x401,0x301,0x201,0x101,0x001,0x008,0x108,0x208,0x308,0x408,0x580, // row 1
|
||||
0x402,0x302,0x202,0x102,0x002,0x010,0x110,0x210,0x310,0x410, // row 2
|
||||
0x404,0x304,0x204,0x104,0x004,0x040,0x140,0x240,0x340,0x440, // row 3
|
||||
0x420,0x320,0x220,0x120,0x020,0x080,0x180,0x280,0x380,0x480, // row 4
|
||||
0x520,0x540,0x510,0x508,0x502,0x504 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,9 +4,14 @@
|
|||
// #define RAM_SIZE 0xF8000 // 512k //655360UL
|
||||
// #define NATIVE_RAM (0X28000) // 128k+32768 //231424UL
|
||||
|
||||
#include "platform_config.h"
|
||||
|
||||
|
||||
#ifdef HAS_PSRAM
|
||||
#define RAM_SIZE 0x80000 // 512k //655360UL
|
||||
#else
|
||||
#define RAM_SIZE 0x40000 // 256k
|
||||
#endif
|
||||
|
||||
#define NATIVE_RAM (0X40000) // 256k
|
||||
#define NATIVE_START 0UL
|
||||
|
||||
|
|
|
@ -16,13 +16,13 @@ extern "C" {
|
|||
volatile bool vbl=true;
|
||||
|
||||
bool repeating_timer_callback(struct repeating_timer *t) {
|
||||
uint16_t bClick = emu_DebounceLocalKeys();
|
||||
emu_Input(bClick);
|
||||
if (vbl) {
|
||||
vbl = false;
|
||||
} else {
|
||||
vbl = true;
|
||||
}
|
||||
uint16_t bClick = emu_DebounceLocalKeys();
|
||||
emu_Input(bClick);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ static int skip=0;
|
|||
|
||||
#include "hardware/clocks.h"
|
||||
#include "hardware/vreg.h"
|
||||
#include "hardware/sync.h"
|
||||
|
||||
#include "hdmi_framebuffer.h"
|
||||
|
||||
|
@ -110,14 +111,22 @@ void emu_DrawVsync(void)
|
|||
{
|
||||
skip += 1;
|
||||
skip &= VID_FRAME_SKIP;
|
||||
|
||||
if ( emu_IsVga() ) {
|
||||
tft.waitSync();
|
||||
#ifdef HAS_USBPIO
|
||||
#else
|
||||
#ifdef USE_VGA
|
||||
tft.waitSync();
|
||||
#else
|
||||
if (tft.getMode() == MODE_TFT_320x240) {
|
||||
volatile bool vb=vbl;
|
||||
while (vbl==vb) {
|
||||
__dmb();
|
||||
}
|
||||
}
|
||||
else {
|
||||
volatile bool vb=vbl;
|
||||
while (vbl==vb) {};
|
||||
}
|
||||
tft.waitSync();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Plik binarny nie jest wyświetlany.
|
@ -172,9 +172,9 @@ void ExecZ80(void)
|
|||
* at the moment so not worth it currently.
|
||||
*/
|
||||
if (nrmvideo)
|
||||
v=mem[((i&0xfe)<<8)|((op&63)<<3)|ulacharline];
|
||||
v=zxmemory[((i&0xfe)<<8)|((op&63)<<3)|ulacharline];
|
||||
else
|
||||
v=mem[(i<<8)|(r&0x80)|(radjust&0x7f)];
|
||||
v=zxmemory[(i<<8)|(r&0x80)|(radjust&0x7f)];
|
||||
//if(taguladisp) v^=128;
|
||||
scrnbmp_new[y*(ZX_VID_FULLWIDTH/8)+x]=((op&128)?~v:v);
|
||||
}
|
||||
|
@ -420,14 +420,14 @@ void ResetZ80(void)
|
|||
} else {
|
||||
sp = 0x4000 - 4 + ramsize * 1024;
|
||||
}
|
||||
mem[sp + 0] = 0x47;
|
||||
mem[sp + 1] = 0x04;
|
||||
mem[sp + 2] = 0xba;
|
||||
mem[sp + 3] = 0x3f;
|
||||
zxmemory[sp + 0] = 0x47;
|
||||
zxmemory[sp + 1] = 0x04;
|
||||
zxmemory[sp + 2] = 0xba;
|
||||
zxmemory[sp + 3] = 0x3f;
|
||||
/* Now override if RAM configuration changes things
|
||||
* (there's a possibility these changes are unimportant) */
|
||||
if (ramsize == 16) {
|
||||
mem[sp + 2] = 0x22;
|
||||
zxmemory[sp + 2] = 0x22;
|
||||
}
|
||||
} else {
|
||||
static unsigned char bit1[9]={0xFF,0x80,0xFC,0x7F,0x00,0x80,0x00,0xFE,0xFF};
|
||||
|
@ -435,8 +435,8 @@ void ResetZ80(void)
|
|||
|
||||
/* memory will already be zeroed at this point */
|
||||
|
||||
memcpy(mem+0x4000,bit1,9);
|
||||
memcpy(mem+0x7ffc,bit2,4);
|
||||
memcpy(zxmemory+0x4000,bit1,9);
|
||||
memcpy(zxmemory+0x7ffc,bit2,4);
|
||||
|
||||
a=0x0B; f=0x85; b=0x00; c=0xFF;
|
||||
d=0x43; e=0x99; h=0xC3; l=0x99;
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef unsigned char byte;
|
|||
#define AY_TYPE_ZONX 2
|
||||
|
||||
|
||||
extern unsigned char * mem;
|
||||
extern unsigned char * zxmemory;
|
||||
extern unsigned char *memptr[64];
|
||||
extern int memattr[64];
|
||||
extern unsigned long tstates,tsmax;
|
||||
|
|
|
@ -15,97 +15,42 @@
|
|||
#define ROMSDIR "z81"
|
||||
|
||||
#define emu_Init(ROM) {z81_Start(ROM); z81_Init(); }
|
||||
#define emu_Step(x) {z81_Step();}
|
||||
#define emu_Step() {z81_Step();}
|
||||
#define emu_Input(x) {z81_Input(x);}
|
||||
|
||||
#ifdef KEYMAP_PRESENT
|
||||
|
||||
#ifdef PICOZX
|
||||
#ifdef PICO2ZX
|
||||
const unsigned short key_map1[] = {
|
||||
30,31,32,33,34,35,36,37,38,39,
|
||||
30,31,32,33,34,35,36,37,38,39,39+64,
|
||||
20,26, 8,21,23,28,24,12,18,19,
|
||||
4,22, 7, 9,10,11,13,14,15,40,
|
||||
0,29,27, 6,25, 5,17,16, 0,44,
|
||||
0,0,0,0,0,0
|
||||
0,29,27, 6,25, 5,17,16, 1,44,
|
||||
0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
const unsigned short key_map2[] = {
|
||||
0,0,0,24+64,34+64,35+64,36+64,37+64,18+64,0,
|
||||
21+64,23+64,28+64,17+64,16+64,31+64,26+64,0,0,19+64,
|
||||
0,0,0,12+64,18+64,0,13+64,14+64,15+64,40+64,
|
||||
0,29+64,27+64, 6+64,25+64, 5+64,1+64,1,0,44+64,
|
||||
0,0,0,0,0,0
|
||||
};
|
||||
// To be mapped
|
||||
//30+64,0,32+64,33+64,0,0,0,0,38+64,39+64,
|
||||
//20+64,0, 8+64,0,0,0,0,0,0,0,
|
||||
//4+64,22+64, 7+64, 9+64,10+64,11+64,0,0,0,0,
|
||||
//0, 0,0, 0,0, 0,0,0, 0,0,
|
||||
//0,0,0,0,0,0
|
||||
//};
|
||||
30+64,31+64,32+64,33+64,34+64,35+64,36+64,37+64,38+64,39+64,39+64,
|
||||
20+64,26+64, 8+64,21+64,23+64,28+64,24+64,12+64,18+64,19+64,
|
||||
4+64,22+64, 7+64, 9+64,10+64,11+64,13+64,14+64,15+64,40+64,
|
||||
0+64,29+64,27+64, 6+64,25+64, 5+64,17+64,16+64, 1+64,44+64,
|
||||
0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
const unsigned short key_map3[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0
|
||||
30+64,31+64,32+64,33+64,34+64,35+64,36+64,37+64,38+64,39+64,39+64,
|
||||
20+64,26+64, 8+64,21+64,23+64,28+64,24+64,12+64,18+64,19+64,
|
||||
4+64,22+64, 7+64, 9+64,10+64,11+64,13+64,14+64,15+64,40+64,
|
||||
0+64,29+64,27+64, 6+64,25+64, 5+64,17+64,16+64, 1+64,44+64,
|
||||
0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x104,0x101,0x108,0x102,0x110,0x120,0x140,0x204,0x201,0x208, // row 1
|
||||
0x202,0x210,0x220,0x240,0x304,0x301,0x308,0x302,0x310,0x320, // row 2
|
||||
0x340,0x404,0x401,0x408,0x402,0x410,0x420,0x440,0x504,0x501, // row 3
|
||||
0x020,0x508,0x502,0x510,0x520,0x540,0x604,0x601,0x040,0x608, // row 4
|
||||
0x008,0x001,0x002,0x010,0x620,0x640 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
|
||||
#else
|
||||
/*
|
||||
{25, 6,27,29,224},// vcxz<caps shift=Lshift>
|
||||
{10, 9, 7,22, 4}, // gfdsa
|
||||
{23,21, 8,26,20}, // trewq
|
||||
{34,33,32,31,30}, // 54321
|
||||
{35,36,37,38,39}, // 67890
|
||||
{28,24,12,18,19}, // yuiop
|
||||
{11,13,14,15,40}, // hjkl<enter>
|
||||
{ 5,17,16,1,44}, // bnm. <space>
|
||||
*/
|
||||
|
||||
#define keylables_map1_0 (char *)"qwertyuiop\x1a"
|
||||
#define keylables_map1_1 (char *)" asdfghjkl\x19"
|
||||
#define keylables_map1_2 (char *)" zxcvbnm.\x10 "
|
||||
const unsigned short key_map1[] = {
|
||||
20,26,8,21,23,28,24,12,18,19,39+64,
|
||||
0, 4, 22, 7,9, 10,11,13,14,15,40,
|
||||
0,29,27,6,25,5,17,16,1,44,
|
||||
0,0,0,0 //up,left,right,down
|
||||
};
|
||||
|
||||
#define keylables_map2_0 (char *)"1234567890="
|
||||
#define keylables_map2_1 (char *)" $ + *- "
|
||||
#define keylables_map2_2 (char *)" ()?/\"<>,: "
|
||||
const unsigned short key_map2[] = {
|
||||
30,31,32,33,34,35,36,37,38,39,15+64,
|
||||
0, 0,0,0,24+64,0,14+64,0,5+64,13+64,0,
|
||||
0, 12+64,18+64,6+64,25+64,19+64,17+64,16+64,1+64,29+64,
|
||||
36+64,34+64,37+64,35+64 //up,left,right,down
|
||||
};
|
||||
|
||||
#define keylables_map3_0 (char *)" "
|
||||
#define keylables_map3_1 (char *)" "
|
||||
#define keylables_map3_2 (char *)" ; "
|
||||
const unsigned short key_map3[] = {
|
||||
0, 0,0,0,0,0,0,0,0,0,0, // Upper case
|
||||
0, 0,0,0,0,0,0,0,0,0,0,
|
||||
0, 0,0,0,0,0,0,0,27+64,0,
|
||||
36+64,34+64,37+64,35+64 //up,left,right,down
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x020,0x120,0x220,0x320,0x420,0x408,0x308,0x208,0x108,0x008,0x002, // row 1
|
||||
0x510,0x010,0x110,0x210,0x310,0x410,0x401,0x301,0x201,0x101,0x001, // row 2
|
||||
0x520,0x102,0x202,0x302,0x402,0x404,0x304,0x204,0x104,0x004, // row 3
|
||||
0x508,0x501,0x502,0x504 }; // cursor keys
|
||||
0x401,0x301,0x201,0x101,0x001,0x008,0x108,0x208,0x308,0x408,0x580, // row 1
|
||||
0x402,0x302,0x202,0x102,0x002,0x010,0x110,0x210,0x310,0x410, // row 2
|
||||
0x404,0x304,0x204,0x104,0x004,0x040,0x140,0x240,0x340,0x440, // row 3
|
||||
0x420,0x320,0x220,0x120,0x020,0x080,0x180,0x280,0x380,0x480, // row 4
|
||||
0x520,0x540,0x510,0x508,0x502,0x504 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -13,9 +13,12 @@ extern "C" {
|
|||
#include <stdio.h>
|
||||
#include "pico_dsp.h"
|
||||
|
||||
volatile bool vbl=true;
|
||||
static bool timer_running=false;
|
||||
static volatile bool vbl=true;
|
||||
|
||||
bool repeating_timer_callback(struct repeating_timer *t) {
|
||||
uint16_t bClick = emu_DebounceLocalKeys();
|
||||
emu_Input(bClick);
|
||||
if (vbl) {
|
||||
vbl = false;
|
||||
} else {
|
||||
|
@ -29,6 +32,9 @@ static int skip=0;
|
|||
|
||||
#include "hardware/clocks.h"
|
||||
#include "hardware/vreg.h"
|
||||
#include "hardware/sync.h"
|
||||
|
||||
static unsigned short palette16[PALETTE_SIZE];
|
||||
|
||||
int main(void) {
|
||||
// vreg_set_voltage(VREG_VOLTAGE_1_05);
|
||||
|
@ -67,14 +73,12 @@ int main(void) {
|
|||
emu_Init(filename);
|
||||
tft.startRefresh();
|
||||
struct repeating_timer timer;
|
||||
add_repeating_timer_ms(15, repeating_timer_callback, NULL, &timer);
|
||||
add_repeating_timer_ms(20, repeating_timer_callback, NULL, &timer);
|
||||
timer_running=true;
|
||||
while (true) {
|
||||
uint16_t bClick = emu_DebounceLocalKeys();
|
||||
emu_Input(bClick);
|
||||
emu_Step();
|
||||
emu_Step();
|
||||
}
|
||||
}
|
||||
static unsigned short palette16[PALETTE_SIZE];
|
||||
void emu_SetPaletteEntry(unsigned char r, unsigned char g, unsigned char b, int index)
|
||||
{
|
||||
if (index<PALETTE_SIZE) {
|
||||
|
@ -109,9 +113,16 @@ void emu_DrawVsync(void)
|
|||
#else
|
||||
#ifdef USE_VGA
|
||||
tft.waitSync();
|
||||
#else
|
||||
volatile bool vb=vbl;
|
||||
while (vbl==vb) {};
|
||||
#else
|
||||
if (tft.getMode() == MODE_TFT_320x240) {
|
||||
volatile bool vb=vbl;
|
||||
while (vbl==vb) {
|
||||
__dmb();
|
||||
}
|
||||
}
|
||||
else {
|
||||
tft.waitSync();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -2,5 +2,6 @@
|
|||
#define _PROGRAM_CONFIG_H_
|
||||
|
||||
#define KEYBOARD_ACTIVATED 1
|
||||
//#define OVERRULE_HEIGHT 192
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const unsigned char PROGMEM zx80rom[] = {
|
||||
const unsigned char zx80rom[] = {
|
||||
0x21, 0xff, 0x7f, 0x3e, 0x3f, 0xc3, 0x61, 0x02, 0xe1, 0x6e, 0xfd, 0xcb, 0x00, 0x7e, 0x18, 0x03,
|
||||
0xc3, 0x60, 0x05, 0xc8, 0xfd, 0x75, 0x00, 0xc9, 0x18, 0x38, 0x2a, 0x26, 0x40, 0x7e, 0xa7, 0xc0,
|
||||
0xcd, 0x52, 0x00, 0x18, 0xf9, 0xcd, 0x55, 0x00, 0xcd, 0x1a, 0x00, 0x06, 0x00, 0xc3, 0xe1, 0x09,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
#define PROGMEM
|
||||
#include "z80.h"
|
||||
//#include "Arduino.h"
|
||||
#include "zx80rom.h"
|
||||
|
@ -12,22 +10,22 @@
|
|||
#define MEMORYRAM_SIZE 0x10000
|
||||
|
||||
static AY8910 ay;
|
||||
//byte memo[ MEMORYRAM_SIZE ];
|
||||
byte * mem = 0;
|
||||
static byte memory[ MEMORYRAM_SIZE ];
|
||||
static int unexpanded=0;
|
||||
static int signal_int_flag=0;
|
||||
unsigned char * zxmemory;
|
||||
unsigned char *memptr[64];
|
||||
int memattr[64];
|
||||
int unexpanded=0;
|
||||
int nmigen=0,hsyncgen=0,vsync=0;
|
||||
int vsync_visuals=0;
|
||||
int signal_int_flag=0;
|
||||
int interrupted=0;
|
||||
int ramsize=32; //32;
|
||||
int zx80=0;
|
||||
int autoload=1;
|
||||
|
||||
/* the keyboard state and other */
|
||||
static byte keyboard[ 8 ] = {0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff};;
|
||||
static byte * XBuf=0;
|
||||
int zx80=0;
|
||||
int autoload=1;
|
||||
static byte XBuf[ WIDTH*8 ];
|
||||
|
||||
|
||||
struct { unsigned char R,G,B; } Palette[2] = {
|
||||
|
@ -312,32 +310,32 @@ const short keyboardAsciiConv[] = // Ascii to Spectrum keys
|
|||
/* 0x3E */ 16+64, // >
|
||||
/* 0x3F */ 6+64, // ?
|
||||
/* 0x40 */ INV_KEY, // @
|
||||
/* 0x41 */ INV_KEY, // A
|
||||
/* 0x42 */ INV_KEY, // B
|
||||
/* 0x43 */ INV_KEY, // C
|
||||
/* 0x44 */ INV_KEY, // D
|
||||
/* 0x45 */ INV_KEY, // E
|
||||
/* 0x46 */ INV_KEY, // F
|
||||
/* 0x47 */ INV_KEY, // G
|
||||
/* 0x48 */ INV_KEY, // H
|
||||
/* 0x49 */ INV_KEY, // I
|
||||
/* 0x4A */ INV_KEY, // J
|
||||
/* 0x4B */ INV_KEY, // K
|
||||
/* 0x4C */ INV_KEY, // L
|
||||
/* 0x4D */ INV_KEY, // M
|
||||
/* 0x4E */ INV_KEY, // N
|
||||
/* 0x4F */ INV_KEY, // O
|
||||
/* 0x50 */ INV_KEY, // P
|
||||
/* 0x51 */ INV_KEY, // Q
|
||||
/* 0x52 */ INV_KEY, // R
|
||||
/* 0x53 */ INV_KEY, // S
|
||||
/* 0x54 */ INV_KEY, // T
|
||||
/* 0x55 */ INV_KEY, // U
|
||||
/* 0x56 */ INV_KEY, // V
|
||||
/* 0x57 */ INV_KEY, // W
|
||||
/* 0x58 */ INV_KEY, // X
|
||||
/* 0x59 */ INV_KEY, // Y
|
||||
/* 0x5A */ INV_KEY, // Z
|
||||
/* 0x41 */ 4, // A
|
||||
/* 0x42 */ 5, // B
|
||||
/* 0x43 */ 6, // C
|
||||
/* 0x44 */ 7, // D
|
||||
/* 0x45 */ 8, // E
|
||||
/* 0x46 */ 9, // F
|
||||
/* 0x47 */ 10, // G
|
||||
/* 0x48 */ 11, // H
|
||||
/* 0x49 */ 12, // I
|
||||
/* 0x4A */ 13, // J
|
||||
/* 0x4B */ 14, // K
|
||||
/* 0x4C */ 15, // L
|
||||
/* 0x4D */ 16, // M
|
||||
/* 0x4E */ 17, // N
|
||||
/* 0x4F */ 18, // O
|
||||
/* 0x50 */ 19, // P
|
||||
/* 0x51 */ 20, // Q
|
||||
/* 0x52 */ 21, // R
|
||||
/* 0x53 */ 22, // S
|
||||
/* 0x54 */ 23, // T
|
||||
/* 0x55 */ 24, // U
|
||||
/* 0x56 */ 25, // V
|
||||
/* 0x57 */ 26, // W
|
||||
/* 0x58 */ 27, // X
|
||||
/* 0x59 */ 28, // Y
|
||||
/* 0x5A */ 29, // Z
|
||||
/* 0x5B */ INV_KEY, // square bracket open
|
||||
/* 0x5C */ INV_KEY, // baclslach
|
||||
/* 0x5D */ INV_KEY, // square braquet close
|
||||
|
@ -410,15 +408,12 @@ const short keyboardAsciiConv[] = // Ascii to Spectrum keys
|
|||
/* 0xDF */ INV_KEY
|
||||
};
|
||||
|
||||
static void updateKeyboard (int asckey)
|
||||
static void updateKeyboard (int hk)
|
||||
{
|
||||
int hk = keyboardAsciiConv[asckey];
|
||||
|
||||
memset(keyboard, 0xff, sizeof(keyboard));
|
||||
{
|
||||
int shift = hk;
|
||||
if (hk >=128) hk -= 128;
|
||||
else if (hk >=64) hk -= 64;
|
||||
if (hk >=64) hk -= 64;
|
||||
// scan all possibilities
|
||||
for (int j=0;j<8;j++) {
|
||||
for(int i=0;i<5;i++){
|
||||
|
@ -427,8 +422,7 @@ static void updateKeyboard (int asckey)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (shift >=64) keyboard[0] &= ~ (1<<0); // SHift
|
||||
//else if (shift >=64) keyboard[7] &= ~ (1<<1); // SHift symboles
|
||||
if (shift >=64) keyboard[0] &= ~ (1<<0); // SHift
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -477,7 +471,7 @@ static void handleKeyBuf(void)
|
|||
void reset81()
|
||||
{
|
||||
interrupted=2; /* will cause a reset */
|
||||
memset(mem+0x4000,0,0xc000);
|
||||
memset(zxmemory+0x4000,0,0xc000);
|
||||
}
|
||||
|
||||
void load_p(int a)
|
||||
|
@ -510,7 +504,7 @@ void load_p(int a)
|
|||
}
|
||||
|
||||
autoload=0;
|
||||
emu_FileRead(mem + (zx80?0x4000:0x4009), size, f);
|
||||
emu_FileRead(zxmemory + (zx80?0x4000:0x4009), size, f);
|
||||
emu_FileClose(f);
|
||||
|
||||
if(zx80)
|
||||
|
@ -527,24 +521,24 @@ void save_p(int a)
|
|||
void zx81hacks()
|
||||
{
|
||||
/* patch save routine */
|
||||
mem[0x2fc]=0xed; mem[0x2fd]=0xfd;
|
||||
mem[0x2fe]=0xc3; mem[0x2ff]=0x07; mem[0x300]=0x02;
|
||||
zxmemory[0x2fc]=0xed; zxmemory[0x2fd]=0xfd;
|
||||
zxmemory[0x2fe]=0xc3; zxmemory[0x2ff]=0x07; zxmemory[0x300]=0x02;
|
||||
|
||||
/* patch load routine */
|
||||
mem[0x347]=0xeb;
|
||||
mem[0x348]=0xed; mem[0x349]=0xfc;
|
||||
mem[0x34a]=0xc3; mem[0x34b]=0x07; mem[0x34c]=0x02;
|
||||
zxmemory[0x347]=0xeb;
|
||||
zxmemory[0x348]=0xed; zxmemory[0x349]=0xfc;
|
||||
zxmemory[0x34a]=0xc3; zxmemory[0x34b]=0x07; zxmemory[0x34c]=0x02;
|
||||
}
|
||||
|
||||
void zx80hacks()
|
||||
{
|
||||
/* patch save routine */
|
||||
mem[0x1b6]=0xed; mem[0x1b7]=0xfd;
|
||||
mem[0x1b8]=0xc3; mem[0x1b9]=0x83; mem[0x1ba]=0x02;
|
||||
zxmemory[0x1b6]=0xed; zxmemory[0x1b7]=0xfd;
|
||||
zxmemory[0x1b8]=0xc3; zxmemory[0x1b9]=0x83; zxmemory[0x1ba]=0x02;
|
||||
|
||||
/* patch load routine */
|
||||
mem[0x206]=0xed; mem[0x207]=0xfc;
|
||||
mem[0x208]=0xc3; mem[0x209]=0x83; mem[0x20a]=0x02;
|
||||
zxmemory[0x206]=0xed; zxmemory[0x207]=0xfc;
|
||||
zxmemory[0x208]=0xc3; zxmemory[0x209]=0x83; zxmemory[0x20a]=0x02;
|
||||
}
|
||||
|
||||
static void initmem()
|
||||
|
@ -554,11 +548,11 @@ static void initmem()
|
|||
|
||||
if(zx80)
|
||||
{
|
||||
memset(mem+0x1000,0,0xf000);
|
||||
memset(zxmemory+0x1000,0,0xf000);
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(mem+0x2000,0,0xe000);
|
||||
memset(zxmemory+0x2000,0,0xe000);
|
||||
}
|
||||
|
||||
|
||||
|
@ -567,7 +561,7 @@ static void initmem()
|
|||
for(f=0;f<16;f++)
|
||||
{
|
||||
memattr[f]=memattr[32+f]=0;
|
||||
memptr[f]=memptr[32+f]=mem+1024*count;
|
||||
memptr[f]=memptr[32+f]=zxmemory+1024*count;
|
||||
count++;
|
||||
if(count>=(zx80?4:8)) count=0;
|
||||
}
|
||||
|
@ -579,7 +573,7 @@ static void initmem()
|
|||
for(f=16;f<32;f++)
|
||||
{
|
||||
memattr[f]=memattr[32+f]=1;
|
||||
memptr[f]=memptr[32+f]=mem+1024*(16+count);
|
||||
memptr[f]=memptr[32+f]=zxmemory+1024*(16+count);
|
||||
count++;
|
||||
if(count>=ramsize) count=0;
|
||||
}
|
||||
|
@ -633,19 +627,19 @@ static void initmem()
|
|||
for(f=8;f<16;f++)
|
||||
{
|
||||
memattr[f]=1; /* It's now writable */
|
||||
memptr[f]=mem+1024*f;
|
||||
memptr[f]=zxmemory+1024*f;
|
||||
}
|
||||
case 48:
|
||||
for(f=48;f<64;f++)
|
||||
{
|
||||
memattr[f]=1;
|
||||
memptr[f]=mem+1024*f;
|
||||
memptr[f]=zxmemory+1024*f;
|
||||
}
|
||||
case 32:
|
||||
for(f=32;f<48;f++)
|
||||
{
|
||||
memattr[f]=1;
|
||||
memptr[f]=mem+1024*f;
|
||||
memptr[f]=zxmemory+1024*f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -679,7 +673,6 @@ void z81_Init(void)
|
|||
emu_sndInit();
|
||||
#endif
|
||||
|
||||
if (XBuf == 0) XBuf = (byte *)emu_Malloc(WIDTH*8);
|
||||
/* Set up the palette */
|
||||
int J;
|
||||
for(J=0;J<2;J++)
|
||||
|
@ -687,7 +680,7 @@ void z81_Init(void)
|
|||
|
||||
|
||||
emu_printf("Allocating RAM");
|
||||
if (mem == 0) mem = emu_Malloc(MEMORYRAM_SIZE); //&memo[0];
|
||||
if (zxmemory == 0) zxmemory = &memory[0]; //emu_Malloc(MEMORYRAM_SIZE);
|
||||
|
||||
Reset8910(&ay,3500000,0);
|
||||
|
||||
|
@ -695,15 +688,15 @@ void z81_Init(void)
|
|||
int siz=(zx80?4096:8192);
|
||||
if(zx80)
|
||||
{
|
||||
memcpy( mem + 0x0000, zx80rom, siz );
|
||||
memcpy( zxmemory + 0x0000, zx80rom, siz );
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy( mem + 0x0000, zx81rom, siz );
|
||||
memcpy( zxmemory + 0x0000, zx81rom, siz );
|
||||
}
|
||||
memcpy(mem+siz,mem,siz);
|
||||
memcpy(zxmemory+siz,zxmemory,siz);
|
||||
if(zx80)
|
||||
memcpy(mem+siz*2,mem,siz*2);
|
||||
memcpy(zxmemory+siz*2,zxmemory,siz*2);
|
||||
|
||||
initmem();
|
||||
|
||||
|
@ -721,8 +714,8 @@ void z81_Step(void)
|
|||
|
||||
int k = ik;
|
||||
int hk = ihk;
|
||||
if (iusbhk) hk = iusbhk;
|
||||
|
||||
if (iusbhk) hk = keyboardAsciiConv[iusbhk];
|
||||
|
||||
updateKeyboard(hk);
|
||||
|
||||
Loop8910(&ay,20);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const unsigned char PROGMEM zx81rom[] = {
|
||||
const unsigned char zx81rom[] = {
|
||||
0xd3, 0xfd, 0x01, 0xff, 0x7f, 0xc3, 0xcb, 0x03, 0x2a, 0x16, 0x40, 0x22, 0x18, 0x40, 0x18, 0x46,
|
||||
0xa7, 0xc2, 0xf1, 0x07, 0xc3, 0xf5, 0x07, 0xff, 0x2a, 0x16, 0x40, 0x7e, 0xa7, 0xc0, 0x00, 0x00,
|
||||
0xcd, 0x49, 0x00, 0x18, 0xf7, 0xff, 0xff, 0xff, 0xc3, 0x9d, 0x19, 0xf1, 0xd9, 0xe3, 0xd9, 0xc9,
|
||||
|
|
|
@ -21,83 +21,39 @@
|
|||
|
||||
#ifdef KEYMAP_PRESENT
|
||||
|
||||
#ifdef PICOZX
|
||||
#ifdef PICO2ZX
|
||||
const unsigned short key_map1[] = {
|
||||
2,3,4,5,6,7,8,9,10,1,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0
|
||||
'1','2','3','4','5','6','7','8','9','0',127,
|
||||
'Q','W','E','R','T','Y','U','I','O','P',
|
||||
'A','S','D','F','G','H','J','K','L',0x0D,
|
||||
0,'Z','X','C','V','B','N','M',0,' ',
|
||||
0,0,0,0,127,0 // L R
|
||||
};
|
||||
|
||||
const unsigned short key_map2[] = {
|
||||
0,0,11,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,12,0,0,0,0,
|
||||
0,0,0,0,0,0
|
||||
'!','@','#','$','%','&','\'','(',')','_',0,
|
||||
0,0,0,'<','>',0,0,0,';','"',
|
||||
0,0,0,0,0,'^','-','+','=',0x0D,
|
||||
0,':',0,'?','\/','*',',','.',0,' ',
|
||||
153,151,150,152,0,0 //U L R D
|
||||
};
|
||||
|
||||
const unsigned short key_map3[] = {
|
||||
133,134,135,136,137,138,139,140,0,0,0, // function keys
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0
|
||||
153,151,150,152,0,0 //U L R D
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x104,0x101,0x108,0x102,0x110,0x120,0x140,0x204,0x201,0x208, // row 1
|
||||
0x202,0x210,0x220,0x240,0x304,0x301,0x308,0x302,0x310,0x320, // row 2
|
||||
0x340,0x404,0x401,0x408,0x402,0x410,0x420,0x440,0x504,0x501, // row 3
|
||||
0x020,0x508,0x502,0x510,0x520,0x540,0x604,0x601,0x040,0x608, // row 4
|
||||
0x008,0x001,0x002,0x010,0x620,0x640 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
|
||||
#else
|
||||
#define keylables_map1_0 (char *)"1234567890 "
|
||||
#define keylables_map1_1 (char *)" # * "
|
||||
#define keylables_map1_2 (char *)" "
|
||||
const unsigned short key_map1[] = {
|
||||
2,3,4,5,6,7,8,9,10,1,0,
|
||||
0,0,0,11,0,0,0,0,12,0,0,
|
||||
0, 0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
/*
|
||||
const unsigned short key_map1[] = {
|
||||
2,3,4,
|
||||
5,6,7,
|
||||
8,9,10,
|
||||
11,1,12};
|
||||
*/
|
||||
|
||||
#define keylables_map2_0 (char *)" "
|
||||
#define keylables_map2_1 (char *)" "
|
||||
#define keylables_map2_2 (char *)" "
|
||||
const unsigned short key_map2[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,
|
||||
0, 0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
#define keylables_map3_0 (char *)" "
|
||||
#define keylables_map3_1 (char *)" "
|
||||
#define keylables_map3_2 (char *)" "
|
||||
const unsigned short key_map3[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0, // function keys
|
||||
0, 0,0,0,0,0,0,0,0,0,0,
|
||||
0, 0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x020,0x120,0x220,0x320,0x420,0x408,0x308,0x208,0x108,0x008,0x002, // row 1
|
||||
0x510,0x010,0x110,0x210,0x310,0x410,0x401,0x301,0x201,0x101,0x001, // row 2
|
||||
0x520,0x102,0x202,0x302,0x402,0x404,0x304,0x204,0x104,0x004, // row 3
|
||||
0x508,0x501,0x502,0x504 }; // cursor keys
|
||||
#endif
|
||||
0x401,0x301,0x201,0x101,0x001,0x008,0x108,0x208,0x308,0x408,0x580, // row 1
|
||||
0x402,0x302,0x202,0x102,0x002,0x010,0x110,0x210,0x310,0x410, // row 2
|
||||
0x404,0x304,0x204,0x104,0x004,0x040,0x140,0x240,0x340,0x440, // row 3
|
||||
0x420,0x320,0x220,0x120,0x020,0x080,0x180,0x280,0x380,0x480, // row 4
|
||||
0x520,0x540,0x510,0x508,0x502,0x504 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
#include "platform_config.h"
|
||||
|
||||
#ifndef HAS_PSRAM
|
||||
#define ALL_IN_RAM 1
|
||||
#endif
|
||||
//#define ALL_IN_RAM 1
|
||||
//#define PSRAM_FAKE 1
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
#define FLASH_STORE_START 0x280000
|
||||
#define KEYBOARD_ACTIVATED 1
|
||||
#define NO_SOUND 1
|
||||
#define HAS_PSRAM 1
|
||||
//#define HAS_PSRAM 1
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "dcastaway.h"
|
||||
|
||||
#ifndef NO_SOUND
|
||||
|
||||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
|
@ -10,6 +9,7 @@
|
|||
#include "mem.h"
|
||||
#include "m68k_intrf.h"
|
||||
#include "sound.h"
|
||||
#ifndef NO_SOUND
|
||||
|
||||
#define LONGLONG long long
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#ifndef DCASTAWAY_SOUND_H
|
||||
#define DCASTAWAY_SOUND_H
|
||||
|
||||
#include "dcastaway.h"
|
||||
#include "platform_config.h"
|
||||
#ifndef NO_SOUND
|
||||
#include "dcastaway.h"
|
||||
|
||||
|
||||
#include<stdio.h>
|
||||
|
|
|
@ -19,10 +19,11 @@
|
|||
#define emu_Input(x) {coc_Input(x);}
|
||||
|
||||
#ifdef KEYMAP_PRESENT
|
||||
|
||||
#ifdef PICOZX
|
||||
|
||||
#ifdef PICO2ZX
|
||||
|
||||
const unsigned short key_map1[] = {
|
||||
2,3,4,5,6,7,8,9,10,1,
|
||||
'1','2','3','4','5','6','7','8','9','0',0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
|
@ -30,15 +31,15 @@ const unsigned short key_map1[] = {
|
|||
};
|
||||
|
||||
const unsigned short key_map2[] = {
|
||||
0,0,11,0,0,0,0,0,0,0,
|
||||
0,0,'#',0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,12,0,0,0,0,
|
||||
0,0,0,0,0,'*',0,0,0,0,
|
||||
0,0,0,0,0,0
|
||||
};
|
||||
|
||||
const unsigned short key_map3[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
|
@ -46,56 +47,11 @@ const unsigned short key_map3[] = {
|
|||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x104,0x101,0x108,0x102,0x110,0x120,0x140,0x204,0x201,0x208, // row 1
|
||||
0x202,0x210,0x220,0x240,0x304,0x301,0x308,0x302,0x310,0x320, // row 2
|
||||
0x340,0x404,0x401,0x408,0x402,0x410,0x420,0x440,0x504,0x501, // row 3
|
||||
0x020,0x508,0x502,0x510,0x520,0x540,0x604,0x601,0x040,0x608, // row 4
|
||||
0x008,0x001,0x002,0x010,0x620,0x640 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
|
||||
#else
|
||||
#define keylables_map1_0 (char *)"1234567890 "
|
||||
#define keylables_map1_1 (char *)" # * "
|
||||
#define keylables_map1_2 (char *)" "
|
||||
const unsigned short key_map1[] = {
|
||||
2,3,4,5,6,7,8,9,10,1,0,
|
||||
0,0,0,11,0,0,0,0,12,0,0,
|
||||
0, 0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
/*
|
||||
const unsigned short key_map1[] = {
|
||||
2,3,4,
|
||||
5,6,7,
|
||||
8,9,10,
|
||||
11,1,12};
|
||||
*/
|
||||
|
||||
#define keylables_map2_0 (char *)" "
|
||||
#define keylables_map2_1 (char *)" "
|
||||
#define keylables_map2_2 (char *)" "
|
||||
const unsigned short key_map2[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,
|
||||
0, 0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
#define keylables_map3_0 (char *)" "
|
||||
#define keylables_map3_1 (char *)" "
|
||||
#define keylables_map3_2 (char *)" "
|
||||
const unsigned short key_map3[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0, // function keys
|
||||
0, 0,0,0,0,0,0,0,0,0,0,
|
||||
0, 0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0
|
||||
};
|
||||
|
||||
const unsigned short matkeys[] = {
|
||||
0x020,0x120,0x220,0x320,0x420,0x408,0x308,0x208,0x108,0x008,0x002, // row 1
|
||||
0x510,0x010,0x110,0x210,0x310,0x410,0x401,0x301,0x201,0x101,0x001, // row 2
|
||||
0x520,0x102,0x202,0x302,0x402,0x404,0x304,0x204,0x104,0x004, // row 3
|
||||
0x508,0x501,0x502,0x504 }; // cursor keys
|
||||
0x401,0x301,0x201,0x101,0x001,0x008,0x108,0x208,0x308,0x408,0x580, // row 1
|
||||
0x402,0x302,0x202,0x102,0x002,0x010,0x110,0x210,0x310,0x410, // row 2
|
||||
0x404,0x304,0x204,0x104,0x004,0x040,0x140,0x240,0x340,0x440, // row 3
|
||||
0x420,0x320,0x220,0x120,0x020,0x080,0x180,0x280,0x380,0x480, // row 4
|
||||
0x520,0x540,0x510,0x508,0x502,0x504 }; // cursor keys up, left, right, down, <<<, >>>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Ładowanie…
Reference in New Issue