Skip to content

Commit 3f40f14

Browse files
committed
Revert some hacks and try signalling to emulated firmware with a write to an unrecognized port
1 parent 2cd4e60 commit 3f40f14

File tree

4 files changed

+5
-25
lines changed

4 files changed

+5
-25
lines changed

emulator-patches/fetch.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ static void fetch_range_async(const char* url, size_t first_byte, size_t size,
175175
} else {
176176
ctx->headers = NULL;
177177
}
178-
printf("Range: %s\n", ctx->range);
179178

180179
fetch_attributes.userData = ctx;
181180
fetch_attributes.onsuccess = fetch_with_emscripten_success;

emulator-patches/kinetoscope.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
// SRAM regions.
6666
#define SRAM_BANK_0_OFFSET 0
6767
#define SRAM_BANK_1_OFFSET (1 << 20) // 1MB
68-
#define SRAM_SIZE (3 << 20) // 2MB FIXME
68+
#define SRAM_SIZE (2 << 20) // 2MB
6969

7070
static void write_sram(const uint8_t* data, uint32_t size);
7171
static void reset_sram(int bank);

software/player/src/segavideo_player.c

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -137,24 +137,6 @@ static uint32_t nextFrameNum;
137137
# define kprintf(...)
138138
#endif
139139

140-
141-
#define ERROR_MAX 256
142-
static char error_message_buffer[ERROR_MAX];
143-
144-
// SGDK has no snprintf. God help you if you write more than ERROR_MAX
145-
// characters...
146-
static void errorMessage(const char* format, ...) {
147-
if (errorCallback) {
148-
va_list args;
149-
va_start(args, format);
150-
vsprintf(error_message_buffer, format, args);
151-
va_end(args);
152-
153-
errorCallback(error_message_buffer);
154-
}
155-
}
156-
157-
158140
bool segavideo_validateHeader(const uint8_t* videoData) {
159141
const SegaVideoHeader* header = (const SegaVideoHeader*)videoData;
160142

@@ -367,8 +349,9 @@ static bool nextVideoFrame() {
367349
uint32_t firstSample = (uint32_t)currentChunk.audioStart;
368350
if (firstSample > currentSample) {
369351
kprintf("ERROR: Audio samples do not make sense!");
370-
errorMessage("Oops! (%08x > %08x)", firstSample, currentSample);
371-
return false;
352+
volatile uint16_t* hack_signal = ((volatile uint16_t*)0xA130F3);
353+
*hack_signal = 0;
354+
return true;
372355
}
373356
uint32_t samplesPlayed = (currentSample - firstSample);
374357

@@ -583,12 +566,10 @@ void segavideo_processFrames() {
583566

584567
bool stillPlaying = nextVideoFrame();
585568
if (segavideo_getState() == Error) {
586-
kprintf("Video state error!\n");
587569
return;
588570
}
589571

590572
if (!stillPlaying) {
591-
kprintf("Video stopping!\n");
592573
segavideo_stop();
593574

594575
if (loop) {

software/stream-with-special-hardware/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static void onJoystickEvent(u16 joystick, u16 changed, u16 state) {
4545
}
4646

4747
static void handleError() {
48-
// segavideo_menu_showError();
48+
segavideo_menu_showError();
4949

5050
// Continue to show the error until the user presses something to clear it.
5151
while (segavideo_getState() == Error) {

0 commit comments

Comments
 (0)