mirror of
https://github.com/libretro/Mu.git
synced 2026-02-18 13:46:41 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9766f139e | ||
|
|
b7f7715e75 | ||
|
|
acc21071c6 | ||
|
|
427b59b1b6 |
@@ -8,6 +8,10 @@
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <streams/file_stream.h>
|
||||
@@ -297,7 +301,7 @@ void retro_set_environment(retro_environment_t cb){
|
||||
}
|
||||
|
||||
void retro_set_audio_sample(retro_audio_sample_t cb){
|
||||
|
||||
|
||||
}
|
||||
|
||||
void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb){
|
||||
@@ -320,6 +324,70 @@ void retro_reset(void){
|
||||
emulatorSoftReset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Animation to play when the device is asleep.
|
||||
*
|
||||
* @param video_cb The output callback.
|
||||
* @param width The width of the framebuffer.
|
||||
* @param height The height of the framebuffer.
|
||||
* @return If the sleep animation was successful.
|
||||
* @since 2025/08/11
|
||||
*/
|
||||
static bool sleepAnimation(retro_video_refresh_t video_cb,
|
||||
int32_t width, int32_t height) {
|
||||
static int32_t bump;
|
||||
uint16_t* buf;
|
||||
uint16_t color;
|
||||
size_t bufLen, area;
|
||||
int32_t point;
|
||||
|
||||
// Allocate buffer to render
|
||||
area = width * height;
|
||||
bufLen = area * sizeof(uint16_t);
|
||||
#if defined(_MSC_VER)
|
||||
buf = _alloca(bufLen);
|
||||
#else
|
||||
buf = alloca(bufLen);
|
||||
#endif
|
||||
if (buf == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Wipe everything
|
||||
memset(buf, 0, bufLen);
|
||||
|
||||
if (palmMisc.greenLed) {
|
||||
color = 0x01F1;
|
||||
} else {
|
||||
color = 0xFFFF;
|
||||
|
||||
#if defined(EMU_SUPPORT_PALM_OS5)
|
||||
if (palmMisc.redLed) {
|
||||
color = 0xF700;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Set a "random" pixel to the color
|
||||
point = (int32_t)palmCycleCounter + palmClockMultiplier +
|
||||
palmMisc.dataPort + palmSdCard.responseReadPositionBit + (++bump);
|
||||
if (point < 0)
|
||||
point = -point;
|
||||
point %= width * 2;
|
||||
if (point >= width) {
|
||||
point = width - (point - width);
|
||||
}
|
||||
|
||||
// Set color
|
||||
buf[point] = color;
|
||||
|
||||
// Render the buffer
|
||||
video_cb(buf,
|
||||
width, height, width * sizeof(uint16_t));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void retro_run(void){
|
||||
input_poll_cb();
|
||||
|
||||
@@ -415,9 +483,22 @@ void retro_run(void){
|
||||
//draw mouse
|
||||
if(useJoystickAsMouse)
|
||||
renderMouseCursor(touchCursorX, touchCursorY);
|
||||
|
||||
video_cb(palmFramebuffer, palmFramebufferWidth, screenYEnd, palmFramebufferWidth * sizeof(uint16_t));
|
||||
|
||||
// If the LCD is off, try an animation
|
||||
if (palmMisc.lcdOn == false) {
|
||||
if (!sleepAnimation(video_cb, palmFramebufferWidth, screenYEnd)) {
|
||||
video_cb(palmFramebuffer,
|
||||
palmFramebufferWidth, screenYEnd,
|
||||
palmFramebufferWidth * sizeof(uint16_t));
|
||||
}
|
||||
} else {
|
||||
video_cb(palmFramebuffer,
|
||||
palmFramebufferWidth, screenYEnd,
|
||||
palmFramebufferWidth * sizeof(uint16_t));
|
||||
}
|
||||
|
||||
audio_cb(palmAudio, AUDIO_SAMPLES_PER_FRAME);
|
||||
|
||||
if(led_cb){
|
||||
led_cb(0, palmMisc.greenLed);
|
||||
#if defined(EMU_SUPPORT_PALM_OS5)
|
||||
@@ -715,10 +796,11 @@ bool retro_load_game(const struct retro_game_info *info){
|
||||
strlcat(saveRamPath, ".ram", PATH_MAX_LENGTH);
|
||||
saveRamFile = filestream_open(saveRamPath, RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||
|
||||
// There is now always SRAM because it gets initialized to garbage
|
||||
hasSram = true;
|
||||
|
||||
// Load SRAM from the RAM file (save state), if it happens to fail or
|
||||
// none was loaded then memory has just been filled with garbage
|
||||
if(saveRamFile) {
|
||||
hasSram = true;
|
||||
|
||||
if(filestream_get_size(saveRamFile) == emulatorGetRamSize()){
|
||||
filestream_read(saveRamFile, palmRam, emulatorGetRamSize());
|
||||
swap16BufferIfLittle(palmRam, emulatorGetRamSize() / sizeof(uint16_t));
|
||||
|
||||
@@ -5,7 +5,7 @@ supported_extensions = "prc|pqa|img|pdb|zip"
|
||||
corename = "Mu"
|
||||
license = "CC BY-NC 3.0 US (Non-commercial)"
|
||||
permissions = ""
|
||||
display_version = "v1.3.3"
|
||||
display_version = "v1.3.4"
|
||||
categories = "Emulator"
|
||||
|
||||
# Hardware Information
|
||||
|
||||
@@ -171,50 +171,50 @@ support_palm_os5{
|
||||
../../src/w86l488.c
|
||||
|
||||
HEADERS += \
|
||||
../../src/pxa260/pxa260_CPU.h \
|
||||
../../src/pxa260/pxa260_DMA.h \
|
||||
../../src/pxa260/pxa260_DSP.h \
|
||||
../../src/pxa260/pxa260_GPIO.h \
|
||||
../../src/pxa260/pxa260_IC.h \
|
||||
../../src/pxa260/pxa260_LCD.h \
|
||||
../../src/pxa260/pxa260_PwrClk.h \
|
||||
../../src/pxa260/pxa260_RTC.h \
|
||||
../../src/pxa260/pxa260_TIMR.h \
|
||||
../../src/pxa260/pxa260_UART.h \
|
||||
../../src/pxa260/pxa260I2c.h \
|
||||
../../src/pxa260/pxa260Memctrl.h \
|
||||
../../src/pxa260/pxa260Timing.h \
|
||||
../../src/pxa260/pxa260Ssp.h \
|
||||
../../src/pxa260/pxa260Udc.h \
|
||||
../../src/pxa260/pxa260_types.h \
|
||||
../../src/pxa260/pxa260_math64.h \
|
||||
../../src/pxa260/pxa260Accessors.c.h \
|
||||
../../src/pxa260/pxa260.h \
|
||||
../../src/armv5te/os/os.h \
|
||||
../../src/armv5te/uArm/CPU_2.h \
|
||||
../../src/armv5te/uArm/icache.h \
|
||||
../../src/armv5te/uArm/uArmGlue.h \
|
||||
../../src/armv5te/asmcode.h \
|
||||
../../src/armv5te/bitfield.h \
|
||||
../../src/armv5te/cpu.h \
|
||||
../../src/armv5te/disasm.h \
|
||||
../../src/armv5te/emu.h \
|
||||
../../src/armv5te/mem.h \
|
||||
../../src/armv5te/translate.h \
|
||||
../../src/armv5te/cpudefs.h \
|
||||
../../src/armv5te/debug.h \
|
||||
../../src/armv5te/mmu.h \
|
||||
../../src/armv5te/armsnippets.h \
|
||||
../../src/armv5te/literalpool.h \
|
||||
../../src/tungstenT3Bus.h \
|
||||
../../src/tps65010.h \
|
||||
../../src/tsc2101.h \
|
||||
../../src/w86l488.h
|
||||
../../include/pxa260/pxa260_CPU.h \
|
||||
../../include/pxa260/pxa260_DMA.h \
|
||||
../../include/pxa260/pxa260_DSP.h \
|
||||
../../include/pxa260/pxa260_GPIO.h \
|
||||
../../include/pxa260/pxa260_IC.h \
|
||||
../../include/pxa260/pxa260_LCD.h \
|
||||
../../include/pxa260/pxa260_PwrClk.h \
|
||||
../../include/pxa260/pxa260_RTC.h \
|
||||
../../include/pxa260/pxa260_TIMR.h \
|
||||
../../include/pxa260/pxa260_UART.h \
|
||||
../../include/pxa260/pxa260I2c.h \
|
||||
../../include/pxa260/pxa260Memctrl.h \
|
||||
../../include/pxa260/pxa260Timing.h \
|
||||
../../include/pxa260/pxa260Ssp.h \
|
||||
../../include/pxa260/pxa260Udc.h \
|
||||
../../include/pxa260/pxa260_types.h \
|
||||
../../include/pxa260/pxa260_math64.h \
|
||||
../../include/pxa260/pxa260Accessors.c.h \
|
||||
../../include/pxa260/pxa260.h \
|
||||
../../include/armv5te/os/os.h \
|
||||
../../include/armv5te/uArm/CPU_2.h \
|
||||
../../include/armv5te/uArm/icache.h \
|
||||
../../include/armv5te/uArm/uArmGlue.h \
|
||||
../../include/armv5te/asmcode.h \
|
||||
../../include/armv5te/bitfield.h \
|
||||
../../include/armv5te/cpu.h \
|
||||
../../include/armv5te/disasm.h \
|
||||
../../include/armv5te/emu.h \
|
||||
../../include/armv5te/mem.h \
|
||||
../../include/armv5te/translate.h \
|
||||
../../include/armv5te/cpudefs.h \
|
||||
../../include/armv5te/debug.h \
|
||||
../../include/armv5te/mmu.h \
|
||||
../../include/armv5te/armsnippets.h \
|
||||
../../include/armv5te/literalpool.h \
|
||||
../../include/tungstenT3Bus.h \
|
||||
../../include/tps65010.h \
|
||||
../../include/tsc2101.h \
|
||||
../../include/w86l488.h
|
||||
}
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
INCLUDEPATH += $$PWD/qt-common/include
|
||||
INCLUDEPATH += $$PWD/../../include
|
||||
|
||||
SOURCES += \
|
||||
../../src/ads7846.c \
|
||||
@@ -243,32 +243,32 @@ SOURCES += \
|
||||
settingsmanager.cpp
|
||||
|
||||
HEADERS += \
|
||||
../../src/ads7846.h \
|
||||
../../src/audio/blip_buf.h \
|
||||
../../src/dbvz.h \
|
||||
../../src/dbvzRegisterAccessors.c.h \
|
||||
../../src/dbvzRegisterNames.c.h \
|
||||
../../src/dbvzTiming.c.h \
|
||||
../../src/emulator.h \
|
||||
../../src/fileLauncher/launcher.h \
|
||||
../../src/flx68000.h \
|
||||
../../src/m5XXBus.h \
|
||||
../../src/m68k/m68k.h \
|
||||
../../src/m68k/m68kconf.h \
|
||||
../../src/m68k/m68kcpu.h \
|
||||
../../src/m68k/m68kexternal.h \
|
||||
../../src/m68k/m68kops.h \
|
||||
../../src/pdiUsbD12.h \
|
||||
../../src/pdiUsbD12CommandNames.c.h \
|
||||
../../src/portability.h \
|
||||
../../src/sdCard.h \
|
||||
../../src/sdCardAccessors.c.h \
|
||||
../../src/sdCardCommandNames.c.h \
|
||||
../../src/sdCardCrcTables.c.h \
|
||||
../../src/sed1376.h \
|
||||
../../src/sed1376Accessors.c.h \
|
||||
../../src/sed1376RegisterNames.c.h \
|
||||
../../src/silkscreen.h \
|
||||
../../include/ads7846.h \
|
||||
../../include/audio/blip_buf.h \
|
||||
../../include/dbvz.h \
|
||||
../../include/dbvzRegisterAccessors.c.h \
|
||||
../../include/dbvzRegisterNames.c.h \
|
||||
../../include/dbvzTiming.c.h \
|
||||
../../include/emulator.h \
|
||||
../../include/fileLauncher/launcher.h \
|
||||
../../include/flx68000.h \
|
||||
../../include/m5XXBus.h \
|
||||
../../include/m68k/m68k.h \
|
||||
../../include/m68k/m68kconf.h \
|
||||
../../include/m68k/m68kcpu.h \
|
||||
../../include/m68k/m68kexternal.h \
|
||||
../../include/m68k/m68kops.h \
|
||||
../../include/pdiUsbD12.h \
|
||||
../../include/pdiUsbD12CommandNames.c.h \
|
||||
../../include/portability.h \
|
||||
../../include/sdCard.h \
|
||||
../../include/sdCardAccessors.c.h \
|
||||
../../include/sdCardCommandNames.c.h \
|
||||
../../include/sdCardCrcTables.c.h \
|
||||
../../include/sed1376.h \
|
||||
../../include/sed1376Accessors.c.h \
|
||||
../../include/sed1376RegisterNames.c.h \
|
||||
../../include/silkscreen.h \
|
||||
debugviewer.h \
|
||||
emuwrapper.h \
|
||||
mainwindow.h \
|
||||
|
||||
Reference in New Issue
Block a user