Mostly cosmetic changes
Update headers year Remove useless /// headers that eat lines for no reasons Fixed build issues because of stupid me doing stupid stuff in prototypes. Added color and mono GPU stub. Also a tad of code cleaning.
This commit is contained in:
134
source/memory.c
134
source/memory.c
@@ -1,20 +1,12 @@
|
||||
/*******************************************************************************
|
||||
* NewOswan
|
||||
* memory.c: Memory implementation
|
||||
*
|
||||
* Based on the original Oswan-unix
|
||||
* Copyright (c) 2014-2021 986-Studio. All rights reserved.
|
||||
* Copyright (c) 2014-2022 986-Studio. All rights reserved.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Notes: need to optimize mem_writemem20
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
@@ -37,17 +29,6 @@
|
||||
#include <audio.h>
|
||||
#include <memory.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define IO_ROM_BANK_BASE_SELECTOR 0xC0
|
||||
|
||||
uint8_t *ws_rom;
|
||||
@@ -125,17 +106,6 @@ void dump_memory()
|
||||
}
|
||||
|
||||
#ifndef USE_PAGED_MEMORY_ACCESS
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void mem_writemem20(uint32_t addr, uint8_t value)
|
||||
{
|
||||
uint32_t offset = addr & 0xffff;
|
||||
@@ -156,17 +126,6 @@ void mem_writemem20(uint32_t addr, uint8_t value)
|
||||
// other banks are read-only
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
uint8_t mem_readmem20(uint32_t addr)
|
||||
{
|
||||
uint32_t offset = addr & 0xffff;
|
||||
@@ -372,17 +331,7 @@ void mem_dump_info()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
char *load_file(char *filename)
|
||||
{
|
||||
int fd;
|
||||
@@ -407,17 +356,6 @@ char *load_file(char *filename)
|
||||
return ret_ptr;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
char *create_file(char *filename, uint32_t size)
|
||||
{
|
||||
int fd;
|
||||
@@ -454,17 +392,6 @@ char *create_file(char *filename, uint32_t size)
|
||||
return ret_ptr;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ws_memory_init(uint8_t *rom, uint32_t wsRomSize)
|
||||
{
|
||||
ws_romHeaderStruct *ws_romHeader;
|
||||
@@ -570,81 +497,26 @@ void ws_memory_init(uint8_t *rom, uint32_t wsRomSize)
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ws_memory_reset(void)
|
||||
{
|
||||
memset(internalRam, 0, 0x10000);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ws_memory_done(void)
|
||||
{
|
||||
free(internalRam);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
uint8_t *memory_getRom(void)
|
||||
{
|
||||
return (ws_rom);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
uint32_t memory_getRomSize(void)
|
||||
{
|
||||
return (romSize);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
uint16_t memory_getRomCrc(void)
|
||||
{
|
||||
return (ws_rom_checksum);
|
||||
|
||||
Reference in New Issue
Block a user