mirror of
https://github.com/captain-amygdala/pistorm.git
synced 2026-04-13 07:24:17 +00:00
Merge pull request #18 from beeanyew/wip-crap
License from LinuxJedi, prefetch performance fix
This commit is contained in:
20
LICENSE
Normal file
20
LICENSE
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2021 PiStorm developers
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <assert.h>
|
||||
#include <dirent.h>
|
||||
#include <endian.h>
|
||||
@@ -17,7 +19,6 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include "emulator.h"
|
||||
#include "gpio/ps_protocol.h"
|
||||
#include "platforms/amiga/gayle-ide/ide.h"
|
||||
|
||||
#define SIZE_KILO 1024
|
||||
#define SIZE_MEGA (1024 * 1024)
|
||||
@@ -217,7 +218,3 @@ test_loop:;
|
||||
|
||||
void m68k_set_irq(unsigned int level) {
|
||||
}
|
||||
|
||||
struct ide_controller *get_ide(int index) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "platforms/platforms.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#ifndef _CONFIG_FILE_H
|
||||
#define _CONFIG_FILE_H
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "m68k.h"
|
||||
#include "emulator.h"
|
||||
#include "platforms/platforms.h"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
/**
|
||||
* pistorm
|
||||
* emulator function declarations
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/*
|
||||
Original Copyright 2020 Claude Schwarz
|
||||
Code reorganized and rewritten by
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/*
|
||||
Code reorganized and rewritten by
|
||||
Niklas Ekström 2021 (https://github.com/niklasekstrom)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <linux/input.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <pthread.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
enum keypress_type {
|
||||
|
||||
15
m68kcpu.h
15
m68kcpu.h
@@ -1154,6 +1154,14 @@ static inline uint32 m68ki_ic_readimm16(uint32 address)
|
||||
*/
|
||||
static inline uint m68ki_read_imm_16(void)
|
||||
{
|
||||
uint32_t address = ADDRESS_68K(REG_PC);
|
||||
for (int i = 0; i < read_ranges; i++) {
|
||||
if(address >= read_addr[i] && address < read_upper[i]) {
|
||||
REG_PC += 2;
|
||||
return be16toh(((unsigned short *)(read_data[i] + (address - read_addr[i])))[0]);
|
||||
}
|
||||
}
|
||||
|
||||
m68ki_set_fc(FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */
|
||||
m68ki_cpu.mmu_tmp_fc = FLAG_S | FUNCTION_CODE_USER_PROGRAM;
|
||||
m68ki_cpu.mmu_tmp_rw = 1;
|
||||
@@ -1208,6 +1216,13 @@ static inline uint m68ki_read_imm_32(void)
|
||||
// address = pmmu_translate_addr(address,1);
|
||||
#endif
|
||||
#endif
|
||||
uint32_t address = ADDRESS_68K(REG_PC);
|
||||
for (int i = 0; i < read_ranges; i++) {
|
||||
if(address >= read_addr[i] && address < read_upper[i]) {
|
||||
REG_PC += 4;
|
||||
return be32toh(((unsigned int *)(read_data[i] + (address - read_addr[i])))[0]);
|
||||
}
|
||||
}
|
||||
|
||||
#if M68K_EMULATE_PREFETCH
|
||||
uint temp_val;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "config_file/config_file.h"
|
||||
#include "m68k.h"
|
||||
#include "platforms/amiga/Gayle.h"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//
|
||||
// Gayle.c
|
||||
// Originally based on Omega's Gayle emulation,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
//SPDX-License-Identifier: MIT
|
||||
|
||||
//
|
||||
// Gayle.h
|
||||
// Omega
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "platforms/platforms.h"
|
||||
#include "amiga-autoconf.h"
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "config_file/config_file.h"
|
||||
|
||||
#define AC_Z2_BASE 0xE80000
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "Gayle.h"
|
||||
#include "config_file/config_file.h"
|
||||
#include "amiga-registers.h"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
void configure_rtc_emulation_amiga(uint8_t enabled);
|
||||
void set_hard_drive_image_file_amiga(uint8_t index, char *filename);
|
||||
int custom_read_amiga(struct emulator_config *cfg, unsigned int addr, unsigned int *val, unsigned char type);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <exec/resident.h>
|
||||
#include <exec/memory.h>
|
||||
#include <exec/alerts.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#define PINET_OFFSET 0x80010000
|
||||
#define PINET_REGSIZE 0x00010000
|
||||
#define PINET_UPPER 0x80020000
|
||||
@@ -21,4 +23,4 @@ enum pinet_cmds {
|
||||
PINET_CMD_ADDR3 = 0x18,
|
||||
PINET_CMD_ADDR4 = 0x1C,
|
||||
PINET_CMD_FRAME = 0x1000,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
void pinet_init(char *dev);
|
||||
void handle_pinet_write(uint32_t addr, uint32_t val, uint8_t type);
|
||||
uint32_t handle_pinet_read(uint32_t addr, uint8_t type);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <exec/resident.h>
|
||||
#include <exec/errors.h>
|
||||
#include <exec/memory.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/*
|
||||
* Based on:
|
||||
* Amiga ZZ9000 USB Storage Driver (ZZ9000USBStorage.device)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#define NUM_UNITS 7
|
||||
#define PISCSI_OFFSET 0x80000000
|
||||
#define PISCSI_REGSIZE 0x00010000
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "platforms/amiga/hunk-reloc.h"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "emulator.h"
|
||||
#include "rtg.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdint.h>
|
||||
#include <endian.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#define PIGFX_RTG_BASE 0x70000000
|
||||
#define PIGFX_REG_SIZE 0x00010000
|
||||
#define PIGFX_RTG_SIZE 0x02000000
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#ifndef boardinfo_H
|
||||
#define boardinfo_H
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
// PiStorm RTG driver, VBCC edition.
|
||||
// Based in part on the ZZ9000 RTG driver.
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
// "Register" offsets for sending data to the RTG.
|
||||
enum pi_regs {
|
||||
RTG_COMMAND = 0x00,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#ifndef settings_H
|
||||
#define settings_H
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
int handle_register_read_dummy(unsigned int addr, unsigned char type, unsigned int *val) {
|
||||
if (addr) {}
|
||||
if (type) {}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "platforms.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -57,4 +59,4 @@ struct platform_config *make_platform_config(char *name, char *subsys) {
|
||||
}
|
||||
|
||||
return cfg;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "config_file/config_file.h"
|
||||
|
||||
enum base_platforms {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
void put_rtc_byte(uint32_t address_, uint8_t value, uint8_t rtc_type);
|
||||
uint8_t get_rtc_byte(uint32_t address_, uint8_t rtc_type);
|
||||
|
||||
@@ -5,4 +7,4 @@ enum rtc_types {
|
||||
RTC_TYPE_MSM,
|
||||
RTC_TYPE_RICOH,
|
||||
RTC_TYPE_NONE,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user