Clean up specifications

This commit is contained in:
meepingsnesroms
2018-12-09 14:46:53 -08:00
parent 244facd892
commit cc0508b580
12 changed files with 54 additions and 36 deletions

View File

@@ -129,10 +129,7 @@ HEADERS += \
../../src/m68k/musashi/m68kconf.h \
../../src/m68k/musashi/m68kcpu.h \
../../src/m68k/musashi/m68kops.h \
../../src/specs/emuFeatureRegistersSpec.h \
../../src/specs/hardwareRegisterNames.h \
../../src/specs/pdiUsbD12Commands.h \
../../src/specs/sed1376RegisterNames.h \
../../src/specs/dragonballVzRegisterSpec.h \
../../src/ads7846.h \
../../src/emulator.h \
../../src/endianness.h \
@@ -146,7 +143,11 @@ HEADERS += \
../../src/sdCard.h \
../../src/sed1376.h \
../../src/sed1376Accessors.c.h \
../../src/silkscreen.h
../../src/silkscreen.h \
../../src/specs/sed1376RegisterSpec.h \
../../src/specs/pdiUsbD12CommandSpec.h \
../../src/specs/emuFeatureRegisterSpec.h \
../../src/specs/sdCardCommandSpec.h
FORMS += \
mainwindow.ui \

View File

@@ -35,3 +35,4 @@ v(1/3*3) to v1.0.0(Christmas 2018 - *** ** 2019)
Core:
*SD card support
*fix power button double press bug
*FAME 68k core

View File

@@ -15,7 +15,7 @@
#include "silkscreen.h"
#include "portability.h"
#include "debug/sandbox.h"
#include "specs/emuFeatureRegistersSpec.h"
#include "specs/emuFeatureRegisterSpec.h"
//Memory Map of Palm m515

View File

@@ -13,7 +13,7 @@ extern "C" {
#include "audio/blip_buf.h"
#include "memoryAccess.h"//for size macros
#include "specs/emuFeatureRegistersSpec.h"//for feature names
#include "specs/emuFeatureRegisterSpec.h"//for feature names
//DEFINE INFO!!!
//define EMU_MULTITHREADED to speed up long loops

View File

@@ -3,8 +3,8 @@
#include <string.h>
#include "emulator.h"
#include "specs/hardwareRegisterNames.h"
#include "specs/emuFeatureRegistersSpec.h"
#include "specs/dragonballVzRegisterSpec.h"
#include "specs/emuFeatureRegisterSpec.h"
#include "hardwareRegisters.h"
#include "memoryAccess.h"
#include "portability.h"

View File

@@ -4,15 +4,12 @@
#include "emulator.h"
#include "portability.h"
#include "specs/pdiUsbD12Commands.h"
#include "specs/pdiUsbD12CommandSpec.h"
//this is only emulating the commands and USB transfer, the internals of the chip are not documented so any invalid behavior may not match that of the original chip
//running a new command before finishing the previous one will result in corruption
enum{
PDIUSBD12_COMMAND_SET_DMA = 0xFB,
PDIUSBD12_NONE = 0x00
};
#define PDIUSBD12_TRANSFER_BUFFER_SIZE 130
@@ -49,7 +46,7 @@ uint64_t pdiUsbD12StateSize(void){
uint64_t size = 0;
size += PDIUSBD12_TRANSFER_BUFFER_SIZE;
size += sizeof(uint8_t) * 2;
size += sizeof(uint8_t) * 3;
return size;
}
@@ -57,6 +54,8 @@ uint64_t pdiUsbD12StateSize(void){
void pdiUsbD12SaveState(uint8_t* data){
uint64_t offset = 0;
writeStateValue8(data + offset, pdiUsbD12Command);
offset += sizeof(uint8_t);
memcpy(data + offset, pdiUsbD12FifoBuffer, PDIUSBD12_TRANSFER_BUFFER_SIZE);
offset += PDIUSBD12_TRANSFER_BUFFER_SIZE;
writeStateValue8(data + offset, pdiUsbD12ReadIndex);
@@ -68,6 +67,8 @@ void pdiUsbD12SaveState(uint8_t* data){
void pdiUsbD12LoadState(uint8_t* data){
uint64_t offset = 0;
pdiUsbD12Command = readStateValue8(data + offset);
offset += sizeof(uint8_t);
memcpy(pdiUsbD12FifoBuffer, data + offset, PDIUSBD12_TRANSFER_BUFFER_SIZE);
offset += PDIUSBD12_TRANSFER_BUFFER_SIZE;
pdiUsbD12ReadIndex = readStateValue8(data + offset);
@@ -77,32 +78,29 @@ void pdiUsbD12LoadState(uint8_t* data){
}
uint8_t pdiUsbD12GetRegister(bool address){
//just log all USB accesses for now
//debugLog("USB read, address:0x%01X\n", address);
if(!address){
//0x0 data
debugLog("USB read data\n");
return pdiUsbD12FifoRead();
}
else{
//0x1 commands
debugLog("USB read command\n", address);
//may just return 0x00(or random 0xXX) or may return current command(not read by Palm OS during boot up)
debugLog("USB command readback, response unknown, address:0x%01X\n", address);
}
return 0x00;
}
void pdiUsbD12SetRegister(bool address, uint8_t value){
//just log all USB accesses for now
//debugLog("USB write, address:0x%01X, value:0x%02X\n", address, value);
if(!address){
//0x0 data
debugLog("USB write data, value:0x%02X\n", value);
pdiUsbD12FifoWrite(value);
}
else{
//0x1 commands
debugLog("USB write command, value:0x%02X\n", value);
pdiUsbD12FifoStartNewCommand();
switch(value){

View File

@@ -5,7 +5,7 @@
#include "portability.h"
#include "hardwareRegisters.h"
#include "flx68000.h"//for flx68000GetPc()
#include "specs/sed1376RegisterNames.h"
#include "specs/sed1376RegisterSpec.h"
#include "debug/sandbox.h"

View File

@@ -1,14 +1,14 @@
#ifndef HARDWARE_REGISTER_NAMES_HEADER
#define HARDWARE_REGISTER_NAMES_HEADER
#ifndef DRAGONBALL_VZ_REGISTER_SPEC_H
#define DRAGONBALL_VZ_REGISTER_SPEC_H
/*Dragonball VZ Hardware Register Definitions*/
/*Dragonball VZ Register Definitions*/
#define HW_REG_ADDR(x) (0xFFFFF000 | (x))
/*SIM - System Integration Module*/
#define SCR 0x000/*System Control Register*/
#define PCR 0x003/*Peripheral control register*/
#define IDR 0x004/*Silicon ID register*/
#define IODCR 0x008/*I/O drive control register*/
#define PCR 0x003/*Peripheral Control Register*/
#define IDR 0x004/*Silicon ID Register*/
#define IODCR 0x008/*I/O Drive Control Register*/
/*CS - Chip Select*/
#define CSGBA 0x100/*Chip Select Group A Base Register*/
@@ -23,7 +23,7 @@
#define CSB 0x112/*Group B Chip Select Register*/
#define CSC 0x114/*Group C Chip Select Register*/
#define CSD 0x116/*Group D Chip Select Register*/
#define EMUCS 0x118/*Emulation chip-select register*/
#define EMUCS 0x118/*Emulation Chip Select Register*/
/*PLL - Phase Locked Loop*/
#define PLLCR 0x200/*PLL Control Register*/

View File

@@ -1,5 +1,5 @@
#ifndef EMU_FEATURE_REGISTERS_SPEC_HEADER
#define EMU_FEATURE_REGISTERS_SPEC_HEADER
#ifndef EMU_FEATURE_REGISTER_SPEC_H
#define EMU_FEATURE_REGISTER_SPEC_H
/*
All emu feature registers are 32 bit accessing them in any other way will be undefined behavior.

View File

@@ -1,5 +1,5 @@
#ifndef PDIUSBD12_COMMANDS_HEADER
#define PDIUSBD12_COMMANDS_HEADER
#ifndef PDI_USB_D12_COMMAND_SPEC_H
#define PDI_USB_D12_COMMAND_SPEC_H
/*PDIUSBD12 Commands*/
#define SELECT_ENDPOINT_CTRL_OUT 0x00

View File

@@ -0,0 +1,18 @@
#ifndef SD_CARD_COMMAND_SPEC_HEADER
#define SD_CARD_COMMAND_SPEC_HEADER
/*SD Card Commands*/
/*see http://elm-chan.org/docs/mmc/mmc_e.html for more command information*/
#define GO_IDLE_STATE 0/*software reset*/
#define SEND_OP_COND 1/*initiate initialization process*/
#define SEND_CSD 9/*read CSD register*/
#define SEND_CID 10/*read CID register*/
#define STOP_TRANSMISSION 12/*stop to read data*/
#define SET_BLOCKLEN 16/*change R/W block size*/
#define READ_SINGLE_BLOCK 17/*read a block*/
#define READ_MULTIPLE_BLOCK 18/*read multiple blocks*/
#define WRITE_SINGLE_BLOCK 24/*write a block*/
#define WRITE_MULTIPLE_BLOCK 25/*write multiple blocks*/
#define READ_OCR 58/*read OCR(operation condtion register)*/
#endif

View File

@@ -1,5 +1,5 @@
#ifndef SED1376_REGISTER_NAMES_HEADER
#define SED1376_REGISTER_NAMES_HEADER
#ifndef SED1376_REGISTER_NAMES_H
#define SED1376_REGISTER_NAMES_H
/*SED1376 Register Definitions*/
/*Read-Only Configuration Registers*/