VOGONS

Common searches


Save States - Proof of concept

Topic actions

Reply 121 of 227, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

The following steps are important for saving/loading procedure.
Run an app -> Save state to disk -> Exit DOSBox -> Run the app again -> Load state from disk
Just saving/loading without restarting DOSBox seems to be okay though.

Reply 122 of 227, by tikalat

User metadata
Rank Member
Rank
Member

@robertmo
I have a good amount of debug + debugger + cheats + misc + experimental stuff in my modified build. Can't just simply 'diff'. 🙁

@ykhwong
Okay, I understand now. You're loading a loadstate at the CMOS screen (before the game fully boots up)?

That doesn't work yet. I normally wait until the game fully boots, then loadstate. That's worked okay for me to date.

I think it has to do with 'un-init' data that gets 'init'ed at usage run-time. May look into this.

Reply 123 of 227, by tikalat

User metadata
Rank Member
Rank
Member

Archive of savestate diffs - each one is to be used with a clean svn 2012-02-20 build.

Added TheGreatCodeholio's GUS stereo patch also.

Attachments

  • Filename
    2012-02-20 svn diff.7z
    File size
    39.06 KiB
    Downloads
    298 downloads
    File comment
    ykhwong svn-daum 2012-02-20
    File license
    Fair use/fair dealing exception

Reply 124 of 227, by tikalat

User metadata
Rank Member
Rank
Member
011

midi_mt32.h
- using sergm's syncthread file
+ added class MidiHandler_mt32 functions
- GetSynth
- Reset
+ added class RingBuffer function
- reset

midi.cpp
+ Updated to MT-32 sergm class POD format

dosbox.cpp
- using sergm's new MT-32 config format



012

cpu.cpp
+ proper 'cpudecoder' POD

paging.cpp
- remove 'static' from PageFaultCore

iohandler.cpp
- remove 'static' from IOFaultCore

Applying patch 011 will install -all- updates from 001-011.
Applying patch 012 will install -all- updates from 001-012.

NOTES:
011 = uses sergm's new MT-32 code syncthread method
- faster than old multicore method
- doesn't lockup at boot (old code had a rare lockup bug)
- multicore handles buffers > 255 bytes (old bug too sometimes)

mt32.reverse.stereo=off
mt32.verbose=off
mt32.thread=off
mt32.dac=0
mt32.reverb.mode=auto
mt32.reverb.time=5
mt32.reverb.level=3

012 = proper cpudecoder POD support
- fixes loadstate lockups from CMOS
- fixes random loadstate lockups from HLT exceptions

Attachments

Reply 125 of 227, by tikalat

User metadata
Rank Member
Rank
Member
013

mixer.cpp
+ Rework channel POD state (vars)
+ Add 'enabled'
- Remove 'done', 'needed', 'last'
(Reset mixer vars instead on loadstate)

void MixerChannel::SaveState( std::ostream& stream )
void MixerChannel::LoadState( std::istream& stream )



gus.cpp
+ Add mixer channel savestate POD

void POD_Save_GUS( std::ostream& stream )
void POD_Load_GUS( std::istream& stream )

NOTES:
Fixes missing mixer sounds on loadstate (from CMOS or pre-init sound device).

ex. Loadstate 'Another World' from CMOS prompt or title screen (fixes sblaster sounds)

GUS should be fully supported now.
ex. Blackthorne title 'shotgun' SE using GUS (edit: when loadstate from CMOS)

Attachments

Reply 126 of 227, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

I applied your last patch (savestate_013_mixer_channel) and everything seems to work except midi which causes freezing even on runtime.

Edit: I removed this code in setbytes.

MIDI_State_LoadMessage();

Reply 127 of 227, by tikalat

User metadata
Rank Member
Rank
Member

That's an interesting place for a bug. But it doesn't happen for me. 🙁

(Roland virtual SC-55 map = Betrayal at Krondor)
mpu401=intelligent
mididevice=win32
midiconfig=2
mt32.reverse.stereo=off
mt32.verbose=off
mt32.thread=on
mt32.dac=1
mt32.reverb.mode=auto
mt32.reverb.time=5
mt32.reverb.level=1

(MUNT MT-32 = Space Quest 3)
mpu401=intelligent
mididevice=mt32
midiconfig=2
mt32.reverse.stereo=off
mt32.verbose=off
mt32.thread=on
mt32.dac=1
mt32.reverb.mode=auto
mt32.reverb.time=5
mt32.reverb.level=1

Haven't had any crashes with either. Hmm. Wonder what's wrong.

Reply 128 of 227, by tikalat

User metadata
Rank Member
Rank
Member
014

midi.cpp
+ Add real-time MIDI savestate feature
MIDI_State_SaveMessage

NOTES:
This should fix the MIDI crashes. Wasn't there before. Which is probably why LoadState would crash (tries to send -all- junk data on all channels).

And I've noticed a CMOS load problem with Krondor (mouse). Will look at probably.

Attachments

Reply 130 of 227, by tikalat

User metadata
Rank Member
Rank
Member

Quite late for me. I've got the original SQ3 (cga, ega, tandy, pcjr) floppy disk so I'll try them out with Dosbox later this week.

I wouldn't be surprised if CMOS loadstate crashes them though (MMIO handler not done).

Reply 131 of 227, by tikalat

User metadata
Rank Member
Rank
Member
015

dma.cpp
+ Add POD save/load DMA_controller NULL checks

void DmaController::SaveState( std::ostream& stream )
void DmaController::LoadState( std::istream& stream )

NOTES:
Should fix savestate crashes with tandy / cga modes. And likely pcjr.

Attachments

Reply 133 of 227, by tikalat

User metadata
Rank Member
Rank
Member

Ugh. Guess I'll try a very clean build and see how it goes on my end.

016

mouse.cpp
+ Add full POD support

dosbox.cpp
+ Add Sdlmain POD support

sdlmain.cpp
+ Add mouse autolock POD support

NOTES:
Fixes Krondor mouse loadstates from CMOS.

Now I notice that CMOS Krondor loading doesn't detect my in-game saves. o_o

Attachments

Reply 134 of 227, by tikalat

User metadata
Rank Member
Rank
Member
017


dma.cpp
+ Compile error: Add missing sstream header
+ Add class DMAChannel functions
(avoid raw class POD saving)


dma.h
+ Compile error: Add missing DMAController prototypes
+ Add class DMAChannel functions


poly.h
+ Compile error: constuctor


sdlmain.cpp
+ Add sergm MT-32 changes (GUI options)


memory.cpp
+ Add full POD support



018

int10_char.cpp, int10_putpixel.cpp
+ Use h-a-l-9000's pcjr patch

NOTES:

017 = fixes compile errors, add -missing- memory POD
(fixes more loadstate crashes / hangs)

018 = adds h-a-l-9000's pcjr patch

I've changed dma.cpp to -not- write out a -class- as a raw POD. Heard this can cause unexpected problems.

When I mention CMOS, I've disabled the loadstate program check (my private build only). So I'm at a pure CMOS prompt when doing loadstate testing.

If external midi still locks up your emulator, only the non-sysex flushing would cause a pure problem. Are you hooking up a real mt-32?

Attachments

Reply 135 of 227, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie
tikalat wrote:

If external midi still locks up your emulator, only the non-sysex flushing would cause a pure problem. Are you hooking up a real mt-32?

No, I am using default Windows midi device.

Edit: I had to remove "while( midi.cmd_pos != 1 )" in MIDI_State_LoadMessage() to make it work.

Reply 136 of 227, by tikalat

User metadata
Rank Member
Rank
Member
019

midi.cpp
+ Add midi msg reset (loadstate)
+ New midi cmd flushing method (loadstate)


midi_mt32.h
+ Using 'pure' dac = set 1/2 reverb output gain
(per readme)

NOTES:
New MIDI loadstate handler - throws invalid messages to cut current transfers. Also fixes a MIDI loadstate bug caused by random results of interrupting a MIDI transfer.

And forcing MUNT 'pure dac' to set reverb gain to 1/2 of 'normal dac' (readme). Doesn't seem to normally do this from what I can see in MUNT.

I kinda see where the DOS file loading problem is (CMOS loadstate). Still need to what to do about this.

Attachments

Reply 137 of 227, by tikalat

User metadata
Rank Member
Rank
Member
020

dos_files.cpp
= Change to class POD support (Files)
= save state rewrite (class POD support)


dos_system.h
+ Add POD support (DOS_Drive)
= Change to class POD support (DOS_File)
= Enforce virtual use (DOS_Drive)


drives.cpp
+ Add POD functions (DOS_Drive)


part.h
= Enforce virtual use (Part)


cpu.h
= Enforce virtual use (Descriptor)


(misc cleanup)

NOTES:
Big thing is DOS drive POD - saves current directory. Fixes missing file errors (ex. loading Krondor from CMOS)

Reworked DOS files POD to be cleaner - relies on classes to do work.

Added in virtuals to enforce that the right POD structure is saved (fixes possible errors with MUNT rhythm + CPU descriptors)

POD support should be functioning at a high stable level. Minus Adlib or Paging. Or some rarer stuff like xms/ems callbacks. Or glide.

Haven't had any MIDI hangs yet.

Attachments

Reply 138 of 227, by tikalat

User metadata
Rank Member
Rank
Member
021

midi.cpp
+ Fix MIDI polyphony (+ aftertouch poly) (loadstate)

Attachments

Reply 139 of 227, by tikalat

User metadata
Rank Member
Rank
Member
022

midi.cpp
+ Fixes a big logging mistake in setting note-off polyphony

NOTES:
Can re-use old savestates from 021.

Attachments