Skip to content

Commit

Permalink
viewers: Add (S)VGA video memory viewer
Browse files Browse the repository at this point in the history
Add a viewer for (S)VGA video memory. This allows viewing of on and off screen
video memory in the various supported bitmap formats.
  • Loading branch information
sarah-walker-pcem committed Nov 18, 2024
1 parent b934076 commit 7efe8fb
Show file tree
Hide file tree
Showing 5 changed files with 936 additions and 17 deletions.
1 change: 1 addition & 0 deletions includes/private/wx-ui/viewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ void update_viewers_menu(void *menu);
extern viewer_t viewer_font;
extern viewer_t viewer_palette;
extern viewer_t viewer_palette_16;
extern viewer_t viewer_vram;

#define IDM_VIEWER 1600
#define IDM_VIEWER_MAX 1700
Expand Down
2 changes: 2 additions & 0 deletions src/video/vid_svga.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ void svga_poll(void *p) {
}
if (changed) {
viewer_update(&viewer_font, svga);
viewer_update(&viewer_vram, svga);
}
}
if (svga->vc == svga->vsyncstart) {
Expand Down Expand Up @@ -795,6 +796,7 @@ int svga_init(svga_t *svga, void *p, int memsize, void (*recalctimings_ex)(struc
viewer_add("256-colour palette", &viewer_palette, svga);
viewer_add("16-colour palette", &viewer_palette_16, svga);
viewer_add("Font", &viewer_font, svga);
viewer_add("Video memory", &viewer_vram, svga);

return 0;
}
Expand Down
251 changes: 234 additions & 17 deletions src/wx-ui/pc.xrc
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,9 @@
<label>_Machine</label>
</object>
</object>
<object class="wxMenu" name="IDM_VIEW">
<label>_View</label>
</object>
</object>

<ids-range name="IDC_HDPANEL" start="10" />
Expand Down Expand Up @@ -1600,7 +1603,7 @@
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
Expand Down Expand Up @@ -1788,7 +1791,7 @@
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
Expand Down Expand Up @@ -1976,7 +1979,7 @@
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
Expand Down Expand Up @@ -2164,7 +2167,7 @@
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
Expand Down Expand Up @@ -2352,7 +2355,7 @@
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
Expand Down Expand Up @@ -2540,7 +2543,7 @@
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
Expand Down Expand Up @@ -2728,7 +2731,7 @@
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
Expand Down Expand Up @@ -2893,7 +2896,7 @@
</object>
</object>
</object>

<object class="wxDialog" name="HdNewDlg">
<title>New Hard Disc</title>
<centered>1</centered>
Expand Down Expand Up @@ -3521,52 +3524,52 @@
<border>0</border>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>

<object class="sizeritem">
<flag>wxALL</flag>
<border>0</border>
<object class="wxButton" name="IDC_ADD">
<label>Add</label>
</object>
</object>

<object class="sizeritem">
<flag>wxALL</flag>
<border>0</border>
<object class="wxButton" name="IDC_REMOVE">
<label>Remove</label>
</object>
</object>

<object class="spacer">
<option>1</option>
<flag>wxEXPAND</flag>
</object>

<object class="sizeritem">
<flag>wxALL</flag>
<border>0</border>
<object class="wxButton" name="IDC_CONFIG">
<label>Configure...</label>
</object>
</object>

<object class="sizeritem">
<flag>wxALL</flag>
<border>0</border>
<object class="wxButton" name="IDC_MOVE_UP">
<label>Move up</label>
</object>
</object>

<object class="sizeritem">
<flag>wxALL</flag>
<border>0</border>
<object class="wxButton" name="IDC_MOVE_DOWN">
<label>Move down</label>
</object>
</object>

<object class="spacer">
<option>1</option>
<flag>wxEXPAND</flag>
Expand Down Expand Up @@ -3668,7 +3671,7 @@
</object>
</object>
</object>

<object class="wxDialog" name="CustomResolutionDlg">
<style>wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP</style>
<title>Custom resolution</title>
Expand Down Expand Up @@ -3748,7 +3751,221 @@
</object>
</object>
</object>



<object class="wxPanel" name="ViewerVRAMPanel">
<style>wxTAB_TRAVERSAL | wxVSCROLL | wxALWAYS_SHOW_SB</style>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<border>5</border>
<object class="wxStaticText">
<label>Start address:</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_STARTADDR_CURRENT">
<label>Current (xxxxxxx)</label>
<style>wxRB_GROUP</style>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_STARTADDR_CUSTOM">
<label>Custom</label>
<value>1</value>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxTextCtrl" name="IDC_STARTADDR_TEXTCTRL">
<value>0</value>
<style>wxTE_PROCESS_ENTER</style>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<border>5</border>
<object class="wxStaticText">
<label>Pitch:</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_PITCH_CURRENT">
<label>Current (xxxxxxx)</label>
<style>wxRB_GROUP</style>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_PITCH_CUSTOM">
<label>Custom</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxTextCtrl" name="IDC_PITCH_TEXTCTRL">
<value>80</value>
<style>wxTE_PROCESS_ENTER</style>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<border>5</border>
<object class="wxStaticText">
<label>Colour depth:</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_DEPTH_CURRENT">
<label>Current (xxxxxxx)</label>
<style>wxRB_GROUP</style>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_DEPTH_1BPP">
<label>2 colours</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_DEPTH_2BPP">
<label>4 colours</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_DEPTH_4BPP">
<label>16 colours</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_DEPTH_8BPP">
<label>256 colours</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_DEPTH_1555">
<label>32k colours (555) </label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_DEPTH_565">
<label>64k colours (565)</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_DEPTH_888">
<label>16M colours (888)</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_DEPTH_8888">
<label>16M colours (8888)</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<border>5</border>
<object class="wxStaticText">
<label>Address mode:</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_ADDRMODE_CURRENT">
<label>Current</label>
<style>wxRB_GROUP</style>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_ADDRMODE_NORMAL">
<label>Normal</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_ADDRMODE_ODDEVEN">
<label>Odd/even</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxRadioButton" name="IDC_ADDRMODE_CHAIN4">
<label>Chain-4</label>
</object>
</object>

<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<border>5</border>
<object class="wxStaticText">
<label>Scale factor:</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<object class="wxSpinCtrl" name="IDC_SCALE">
<style>wxSP_ARROW_KEYS</style>
<value>1</value>
<min>1</min>
<max>16</max>
</object>
</object>
</object>
</object>


<object class="wxDialog" name="AboutDlg">
<style>wxDEFAULT_DIALOG_STYLE</style>
<title></title>
Expand Down
Loading

0 comments on commit 7efe8fb

Please sign in to comment.