Revert bpp removal, and update screen events docs

`bpp` was depended by main.js for the runtime info display
This commit is contained in:
Ernest Wong 2018-01-23 14:20:57 +13:00 committed by Fabian
parent 282207ff53
commit d32d677d0c
3 changed files with 6 additions and 6 deletions

View file

@ -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.
@ -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]`

View file

@ -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];
});

View file

@ -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 ||
@ -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]);
}
};