Skip to content

Commit

Permalink
Revert bpp removal, and update screen events docs
Browse files Browse the repository at this point in the history
`bpp` was depended by main.js for the runtime info display
  • Loading branch information
ErnWong authored and copy committed Jan 23, 2018
1 parent 282207f commit d32d677
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/events.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Here is a list of events that can be listened to using
[`add_listener`](api.md#add_listenerstring-event-function-listener). These
can be used to programtically control the emulator. Events cannot be sent to
can be used to programmatically control the emulator. Events cannot be sent to
the emulator (although it is internally implemented that way), use the
[API](api.md) methods for that.

Expand All @@ -25,7 +25,7 @@ See also: [screen.js](src/browser/screen.js).
- `screen-put-pixel-linear` - `[number addr, number value]`
- `screen-put-pixel-linear32` - `[number addr, number value]`
- `screen-set-size-text` - `[number cols_count, number rows_count]`
- `screen-set-size-graphical` - `[number width, number height]`
- `screen-set-size-graphical` - `[number width, number height, number virtual_width, number virtual_height, number bpp]`
- `screen-update-cursor` - `[number row, number col]`
- `screen-update-cursor-scanline` - `[number cursor_scanline_start, number cursor_scanline_end]`

Expand Down
2 changes: 1 addition & 1 deletion src/browser/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@
emulator.add_listener("screen-set-size-graphical", function(args)
{
$("info_res").textContent = args[0] + "x" + args[1];
$("info_bpp").textContent = args[2];
$("info_bpp").textContent = args[4];
});


Expand Down
6 changes: 3 additions & 3 deletions src/vga.js
Original file line number Diff line number Diff line change
Expand Up @@ -1138,9 +1138,8 @@ VGAScreen.prototype.set_size_text = function(cols_count, rows_count)

VGAScreen.prototype.set_size_graphical = function(width, height, bpp, virtual_width, virtual_height)
{
this.stats.bpp = bpp;

var needs_update = !this.stats.is_graphical ||
this.stats.bpp !== bpp ||
this.screen_width !== width ||
this.screen_height !== height ||
this.virtual_width !== virtual_width ||
Expand All @@ -1153,11 +1152,12 @@ VGAScreen.prototype.set_size_graphical = function(width, height, bpp, virtual_wi
this.virtual_width = virtual_width;
this.virtual_height = virtual_height;

this.stats.bpp = bpp;
this.stats.is_graphical = true;
this.stats.res_x = width;
this.stats.res_y = height;

this.bus.send("screen-set-size-graphical", [width, height, virtual_width, virtual_height]);
this.bus.send("screen-set-size-graphical", [width, height, virtual_width, virtual_height, bpp]);
}
};

Expand Down

0 comments on commit d32d677

Please sign in to comment.