Skip to content

Commit 18720bc

Browse files
committed
formatted documents
1 parent f56bd43 commit 18720bc

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

emulator/src/Emulator.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,21 @@ namespace casioemu {
187187
return 0;
188188
});
189189
lua_setfield(lua_state, -2, "tick");
190+
190191
lua_pushcfunction(lua_state, [](lua_State *lua_state) {
191192
Emulator *emu = *(Emulator **)lua_topointer(lua_state, 1);
192193
emu->Shutdown();
193194
return 0;
194195
});
195196
lua_setfield(lua_state, -2, "shutdown");
197+
196198
lua_pushcfunction(lua_state, [](lua_State *lua_state) {
197199
Emulator *emu = *(Emulator **)lua_topointer(lua_state, 1);
198200
emu->SetPaused(lua_toboolean(lua_state, 2));
199201
return 0;
200202
});
201203
lua_setfield(lua_state, -2, "set_paused");
204+
202205
lua_model_ref = LUA_REFNIL;
203206
lua_pushcfunction(lua_state, [](lua_State *lua_state) {
204207
Emulator *emu = *(Emulator **)lua_topointer(lua_state, 1);
@@ -207,7 +210,6 @@ namespace casioemu {
207210
// emu:model() returns the model table
208211
lua_geti(lua_state, LUA_REGISTRYINDEX, emu->lua_model_ref);
209212
return 1;
210-
211213
case 2:
212214
// emu:model(t) sets the model table
213215
if (emu->lua_model_ref != LUA_REFNIL)
@@ -220,6 +222,7 @@ namespace casioemu {
220222
}
221223
});
222224
lua_setfield(lua_state, -2, "model");
225+
223226
lua_pre_tick_ref = LUA_REFNIL;
224227
lua_pushcfunction(lua_state, [](lua_State *lua_state) {
225228
Emulator *emu = *(Emulator **)lua_topointer(lua_state, 1);
@@ -228,6 +231,7 @@ namespace casioemu {
228231
return 0;
229232
});
230233
lua_setfield(lua_state, -2, "pre_tick");
234+
231235
lua_post_tick_ref = LUA_REFNIL;
232236
lua_pushcfunction(lua_state, [](lua_State *lua_state) {
233237
Emulator *emu = *(Emulator **)lua_topointer(lua_state, 1);
@@ -236,6 +240,7 @@ namespace casioemu {
236240
return 0;
237241
});
238242
lua_setfield(lua_state, -2, "post_tick");
243+
239244
lua_setfield(lua_state, -2, "__index");
240245
lua_pushcfunction(lua_state, [](lua_State *) {
241246
return 0;
@@ -353,7 +358,6 @@ namespace casioemu {
353358

354359
void Emulator::Shutdown() {
355360
std::lock_guard<decltype(access_mx)> access_lock(access_mx);
356-
357361
running = false;
358362
}
359363

emulator/src/Peripheral/Screen.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -225,19 +225,23 @@ namespace casioemu {
225225
screen_buffer = new uint8_t[(N_ROW + 1) * ROW_SIZE];
226226

227227
region_buffer.Setup(
228-
0xF800, (N_ROW + 1) * ROW_SIZE, "Screen/Buffer", this, [](MMURegion *region, size_t offset) {
229-
offset -= region->base;
230-
if (offset % ROW_SIZE >= ROW_SIZE_DISP)
231-
return (uint8_t)0;
232-
return ((Screen *)region->userdata)->screen_buffer[offset]; }, [](MMURegion *region, size_t offset, uint8_t data) {
233-
offset -= region->base;
234-
if (offset % ROW_SIZE >= ROW_SIZE_DISP)
235-
return;
236-
237-
auto this_obj = (Screen *)region->userdata;
238-
// * Set require_frame to true only if the value changed.
239-
this_obj->require_frame |= this_obj->screen_buffer[offset] != data;
240-
this_obj->screen_buffer[offset] = data; }, emulator);
228+
0xF800, (N_ROW + 1) * ROW_SIZE, "Screen/Buffer", this,
229+
[](MMURegion *region, size_t offset) {
230+
offset -= region->base;
231+
if (offset % ROW_SIZE >= ROW_SIZE_DISP)
232+
return (uint8_t)0;
233+
return ((Screen *)region->userdata)->screen_buffer[offset];
234+
},
235+
[](MMURegion *region, size_t offset, uint8_t data) {
236+
offset -= region->base;
237+
if (offset % ROW_SIZE >= ROW_SIZE_DISP)
238+
return;
239+
auto this_obj = (Screen *)region->userdata;
240+
// * Set require_frame to true only if the value changed.
241+
this_obj->require_frame |= this_obj->screen_buffer[offset] != data;
242+
this_obj->screen_buffer[offset] = data;
243+
},
244+
emulator);
241245

242246
region_range.Setup(0xF030, 1, "Screen/Range", this, DefaultRead<uint8_t, 0x07, &Screen::screen_range>,
243247
SetRequireFrameWrite<uint8_t, 0x07, &Screen::screen_range>, emulator);

0 commit comments

Comments
 (0)