Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit b763ddc

Browse files
committed
OOPIFY: Improve STATIC_FORWARD
1 parent 4717c4e commit b763ddc

File tree

10 files changed

+73
-71
lines changed

10 files changed

+73
-71
lines changed

libswirl/hw/aica/aica_mmio.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct AICARTC_impl : MMIODevice
131131
}
132132

133133
bool Init() {
134-
rtc_schid = sh4_sched_register(this, 0, STATIC_FORWARD(AICARTC_impl, Update));
134+
rtc_schid = sh4_sched_register(this, 0, STATIC_FORWARD(Update));
135135
sh4_sched_request(rtc_schid, SH4_MAIN_CLOCK);
136136

137137
return true;
@@ -684,16 +684,16 @@ struct AicaDevice final : AICA {
684684

685685
//NRM
686686
//6
687-
sb->RegisterRIO(this, SB_ADST_addr, RIO_WF, 0, STATIC_FORWARD(AicaDevice, Write_SB_ADST));
687+
sb->RegisterRIO(this, SB_ADST_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_ADST));
688688

689689
//I really need to implement G2 dma (and rest dmas actually) properly
690690
//THIS IS NOT AICA, its G2-EXT (BBA)
691691

692-
sb->RegisterRIO(this, SB_E1ST_addr, RIO_WF, 0, STATIC_FORWARD(AicaDevice, Write_SB_E1ST));
693-
sb->RegisterRIO(this, SB_E2ST_addr, RIO_WF, 0, STATIC_FORWARD(AicaDevice, Write_SB_E2ST));
694-
sb->RegisterRIO(this, SB_DDST_addr, RIO_WF, 0, STATIC_FORWARD(AicaDevice, Write_SB_DDST));
692+
sb->RegisterRIO(this, SB_E1ST_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_E1ST));
693+
sb->RegisterRIO(this, SB_E2ST_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_E2ST));
694+
sb->RegisterRIO(this, SB_DDST_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_DDST));
695695

696-
dma_sched_id = sh4_sched_register(this, 0, STATIC_FORWARD(AicaDevice, dma_end_sched));
696+
dma_sched_id = sh4_sched_register(this, 0, STATIC_FORWARD(dma_end_sched));
697697

698698
return true;
699699
}

libswirl/hw/gdrom/gdromv3.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,11 +956,11 @@ struct GDRomV3_impl final : MMIODevice {
956956

957957
bool Init() {
958958

959-
sb->RegisterRIO(this, SB_GDST_addr, RIO_WF, 0, STATIC_FORWARD(GDRomV3_impl, DmaStart));
959+
sb->RegisterRIO(this, SB_GDST_addr, RIO_WF, 0, STATIC_FORWARD(DmaStart));
960960

961-
sb->RegisterRIO(this, SB_GDEN_addr, RIO_WF, 0, STATIC_FORWARD(GDRomV3_impl, DmaEnable));
961+
sb->RegisterRIO(this, SB_GDEN_addr, RIO_WF, 0, STATIC_FORWARD(DmaEnable));
962962

963-
gdrom_schid = sh4_sched_register(this, 0, STATIC_FORWARD(GDRomV3_impl, Update));
963+
gdrom_schid = sh4_sched_register(this, 0, STATIC_FORWARD(Update));
964964

965965
gd_setdisc();
966966

libswirl/hw/holly/holly_intc.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,41 +206,41 @@ struct ASICDevice_impl : ASIC {
206206

207207
bool Init()
208208
{
209-
sb->RegisterRIO(this, SB_ISTNRM_addr, RIO_FUNC, STATIC_FORWARD(ASICDevice_impl, Read_SB_ISTNRM), STATIC_FORWARD(ASICDevice_impl, Write_SB_ISTNRM));
209+
sb->RegisterRIO(this, SB_ISTNRM_addr, RIO_FUNC, STATIC_FORWARD(Read_SB_ISTNRM), STATIC_FORWARD(Write_SB_ISTNRM));
210210

211-
sb->RegisterRIO(this, SB_ISTEXT_addr, RIO_WF, 0, STATIC_FORWARD(ASICDevice_impl, Write_SB_ISTEXT));
211+
sb->RegisterRIO(this, SB_ISTEXT_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_ISTEXT));
212212

213-
sb->RegisterRIO(this, SB_ISTERR_addr, RIO_WF, 0, STATIC_FORWARD(ASICDevice_impl, Write_SB_ISTERR));
213+
sb->RegisterRIO(this, SB_ISTERR_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_ISTERR));
214214

215215
//NRM
216216
//6
217-
sb->RegisterRIO(this, SB_IML6NRM_addr, RIO_WF, 0, STATIC_FORWARD(ASICDevice_impl, Write_SB_IML6NRM));
217+
sb->RegisterRIO(this, SB_IML6NRM_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_IML6NRM));
218218

219219
//4
220-
sb->RegisterRIO(this, SB_IML4NRM_addr, RIO_WF, 0, STATIC_FORWARD(ASICDevice_impl, Write_SB_IML4NRM));
220+
sb->RegisterRIO(this, SB_IML4NRM_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_IML4NRM));
221221

222222
//2
223-
sb->RegisterRIO(this, SB_IML2NRM_addr, RIO_WF, 0, STATIC_FORWARD(ASICDevice_impl, Write_SB_IML2NRM));
223+
sb->RegisterRIO(this, SB_IML2NRM_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_IML2NRM));
224224

225225
//EXT
226226
//6
227-
sb->RegisterRIO(this, SB_IML6EXT_addr, RIO_WF, 0, STATIC_FORWARD(ASICDevice_impl, Write_SB_IML6EXT));
227+
sb->RegisterRIO(this, SB_IML6EXT_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_IML6EXT));
228228

229229
//4
230-
sb->RegisterRIO(this, SB_IML4EXT_addr, RIO_WF, 0, STATIC_FORWARD(ASICDevice_impl, Write_SB_IML4EXT));
230+
sb->RegisterRIO(this, SB_IML4EXT_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_IML4EXT));
231231

232232
//2
233-
sb->RegisterRIO(this, SB_IML2EXT_addr, RIO_WF, 0, STATIC_FORWARD(ASICDevice_impl, Write_SB_IML2EXT));
233+
sb->RegisterRIO(this, SB_IML2EXT_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_IML2EXT));
234234

235235
//ERR
236236
//6
237-
sb->RegisterRIO(this, SB_IML6ERR_addr, RIO_WF, 0, STATIC_FORWARD(ASICDevice_impl, Write_SB_IML6ERR));
237+
sb->RegisterRIO(this, SB_IML6ERR_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_IML6ERR));
238238

239239
//4
240-
sb->RegisterRIO(this, SB_IML4ERR_addr, RIO_WF, 0, STATIC_FORWARD(ASICDevice_impl, Write_SB_IML4ERR));
240+
sb->RegisterRIO(this, SB_IML4ERR_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_IML4ERR));
241241

242242
//2
243-
sb->RegisterRIO(this, SB_IML2ERR_addr, RIO_WF, 0, STATIC_FORWARD(ASICDevice_impl, Write_SB_IML2ERR));
243+
sb->RegisterRIO(this, SB_IML2ERR_addr, RIO_WF, 0, STATIC_FORWARD(Write_SB_IML2ERR));
244244

245245
return true;
246246
}

libswirl/hw/holly/sb.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ struct SystemBus_impl : SystemBus {
144144
RegisterRIO(this, SB_LMMODE1_addr, RIO_DATA);
145145

146146
//0x005F688C SB_FFST R FIFO status
147-
RegisterRIO(this, SB_FFST_addr, RIO_RO_FUNC, STATIC_FORWARD(SystemBus_impl, SB_FFST_read));
147+
RegisterRIO(this, SB_FFST_addr, RIO_RO_FUNC, STATIC_FORWARD(SB_FFST_read));
148148

149149
//0x005F6890 SB_SFRES W System reset
150-
RegisterRIO(this, SB_SFRES_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, SB_SFRES_write32));
150+
RegisterRIO(this, SB_SFRES_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SB_SFRES_write32));
151151

152152
//0x005F689C SB_SBREV R System bus revision number
153153
RegisterRIO(this, SB_SBREV_addr, RIO_CONST);
@@ -227,10 +227,10 @@ struct SystemBus_impl : SystemBus {
227227
RegisterRIO(this, SB_MST_addr, RIO_RO);
228228

229229
//0x005F6C88 SB_MSHTCL W Maple-DMA hard trigger clear
230-
RegisterRIO(this, SB_MSHTCL_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_MSHTCL_addr>));
230+
RegisterRIO(this, SB_MSHTCL_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_MSHTCL_addr>));
231231

232232
//0x005F6C8C SB_MDAPRO W Maple-DMA address range
233-
RegisterRIO(this, SB_MDAPRO_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_MDAPRO_addr>));
233+
RegisterRIO(this, SB_MDAPRO_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_MDAPRO_addr>));
234234

235235

236236
//0x005F6CE8 SB_MMSEL RW Maple MSB selection
@@ -264,39 +264,39 @@ struct SystemBus_impl : SystemBus {
264264

265265

266266
//0x005F7480 SB_G1RRC W System ROM read access timing
267-
RegisterRIO(this, SB_G1RRC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_G1RRC_addr>));
267+
RegisterRIO(this, SB_G1RRC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_G1RRC_addr>));
268268

269269
//0x005F7484 SB_G1RWC W System ROM write access timing
270-
RegisterRIO(this, SB_G1RWC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_G1RWC_addr>));
270+
RegisterRIO(this, SB_G1RWC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_G1RWC_addr>));
271271

272272
//0x005F7488 SB_G1FRC W Flash ROM read access timing
273-
RegisterRIO(this, SB_G1FRC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_G1FRC_addr>));
273+
RegisterRIO(this, SB_G1FRC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_G1FRC_addr>));
274274

275275
//0x005F748C SB_G1FWC W Flash ROM write access timing
276-
RegisterRIO(this, SB_G1FWC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_G1FWC_addr>));
276+
RegisterRIO(this, SB_G1FWC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_G1FWC_addr>));
277277

278278
//0x005F7490 SB_G1CRC W GD PIO read access timing
279-
RegisterRIO(this, SB_G1CRC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_G1CRC_addr>));
279+
RegisterRIO(this, SB_G1CRC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_G1CRC_addr>));
280280

281281
//0x005F7494 SB_G1CWC W GD PIO write access timing
282-
RegisterRIO(this, SB_G1CWC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_G1CWC_addr>));
282+
RegisterRIO(this, SB_G1CWC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_G1CWC_addr>));
283283

284284

285285
//0x005F74A0 SB_G1GDRC W GD-DMA read access timing
286-
RegisterRIO(this, SB_G1GDRC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_G1GDRC_addr>));
286+
RegisterRIO(this, SB_G1GDRC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_G1GDRC_addr>));
287287

288288
//0x005F74A4 SB_G1GDWC W GD-DMA write access timing
289-
RegisterRIO(this, SB_G1GDWC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_G1GDWC_addr>));
289+
RegisterRIO(this, SB_G1GDWC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_G1GDWC_addr>));
290290

291291

292292
//0x005F74B0 SB_G1SYSM R System mode
293293
RegisterRIO(this, SB_G1SYSM_addr, RIO_RO);
294294

295295
//0x005F74B4 SB_G1CRDYC W G1IORDY signal control
296-
RegisterRIO(this, SB_G1CRDYC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_G1CRDYC_addr>));
296+
RegisterRIO(this, SB_G1CRDYC_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_G1CRDYC_addr>));
297297

298298
//0x005F74B8 SB_GDAPRO W GD-DMA address range
299-
RegisterRIO(this, SB_GDAPRO_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_GDAPRO_addr>));
299+
RegisterRIO(this, SB_GDAPRO_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_GDAPRO_addr>));
300300

301301

302302
//0x005F74F4 SB_GDSTARD R GD-DMA address count (on Root Bus)
@@ -425,7 +425,7 @@ struct SystemBus_impl : SystemBus {
425425

426426

427427
//0x005F78BC SB_G2APRO W G2-DMA address range
428-
RegisterRIO(this, SB_G2APRO_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_G2APRO_addr>));
428+
RegisterRIO(this, SB_G2APRO_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_G2APRO_addr>));
429429

430430

431431
//0x005F78C0 SB_ADSTAGD R AICA-DMA address counter (on AICA)
@@ -491,7 +491,7 @@ struct SystemBus_impl : SystemBus {
491491

492492

493493
//0x005F7C80 SB_PDAPRO W PVR-DMA address range
494-
RegisterRIO(this, SB_PDAPRO_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_writeonly<SB_PDAPRO_addr>));
494+
RegisterRIO(this, SB_PDAPRO_addr, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_writeonly<SB_PDAPRO_addr>));
495495

496496

497497
//0x005F7CF0 SB_PDSTAPD R PVR-DMA address counter (on Ext)
@@ -505,18 +505,18 @@ struct SystemBus_impl : SystemBus {
505505

506506
//GDROM unlock register (bios checksumming, etc)
507507
//0x005f74e4
508-
RegisterRIO(this, 0x005f74e4, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_write_gdrom_unlock));
508+
RegisterRIO(this, 0x005f74e4, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_write_gdrom_unlock));
509509

510510
//0x005f68a4, 0x005f68ac, 0x005f78a0,0x005f78a4, 0x005f78a8, 0x005f78b0, 0x005f78b4, 0x005f78b8
511-
RegisterRIO(this, 0x005f68a4, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_write_zero));
512-
RegisterRIO(this, 0x005f68ac, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_write_zero));
513-
RegisterRIO(this, 0x005f78a0, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_write_zero));
514-
RegisterRIO(this, 0x005f78a4, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_write_zero));
515-
RegisterRIO(this, 0x005f78a8, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_write_zero));
516-
RegisterRIO(this, 0x005f78ac, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_write_zero));
517-
RegisterRIO(this, 0x005f78b0, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_write_zero));
518-
RegisterRIO(this, 0x005f78b4, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_write_zero));
519-
RegisterRIO(this, 0x005f78b8, RIO_WO_FUNC, 0, STATIC_FORWARD(SystemBus_impl, sbio_write_zero));
511+
RegisterRIO(this, 0x005f68a4, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_write_zero));
512+
RegisterRIO(this, 0x005f68ac, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_write_zero));
513+
RegisterRIO(this, 0x005f78a0, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_write_zero));
514+
RegisterRIO(this, 0x005f78a4, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_write_zero));
515+
RegisterRIO(this, 0x005f78a8, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_write_zero));
516+
RegisterRIO(this, 0x005f78ac, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_write_zero));
517+
RegisterRIO(this, 0x005f78b0, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_write_zero));
518+
RegisterRIO(this, 0x005f78b4, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_write_zero));
519+
RegisterRIO(this, 0x005f78b8, RIO_WO_FUNC, 0, STATIC_FORWARD(sbio_write_zero));
520520
}
521521

522522
bool Init() {
@@ -654,12 +654,12 @@ struct SystemBus_impl : SystemBus {
654654

655655
if (flags == RIO_NO_ACCESS)
656656
{
657-
sb_regs[idx].readFunctionAddr = STATIC_FORWARD(SystemBus_impl, sbio_read_noacc);
658-
sb_regs[idx].writeFunctionAddr = STATIC_FORWARD(SystemBus_impl, sbio_write_noacc);
657+
sb_regs[idx].readFunctionAddr = STATIC_FORWARD(sbio_read_noacc);
658+
sb_regs[idx].writeFunctionAddr = STATIC_FORWARD(sbio_write_noacc);
659659
}
660660
else if (flags == RIO_CONST)
661661
{
662-
sb_regs[idx].writeFunctionAddr = STATIC_FORWARD(SystemBus_impl, sbio_write_const);
662+
sb_regs[idx].writeFunctionAddr = STATIC_FORWARD(sbio_write_const);
663663
}
664664
else
665665
{
@@ -669,7 +669,7 @@ struct SystemBus_impl : SystemBus {
669669
sb_regs[idx].readFunctionAddr = rf;
670670

671671
if (flags & REG_WF)
672-
sb_regs[idx].writeFunctionAddr = wf == 0 ? STATIC_FORWARD(SystemBus_impl, sbio_write_noacc) : wf;
672+
sb_regs[idx].writeFunctionAddr = wf == 0 ? STATIC_FORWARD(sbio_write_noacc) : wf;
673673
}
674674
}
675675
};

libswirl/hw/holly/sb.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ extern Array<RegisterStruct> sb_regs;
8080

8181
#include "sb_regs.h"
8282

83+
#include <type_traits>
84+
8385
// Template magic for STATIC_FORWARD
8486
template <class T>
8587
class FI {
@@ -88,14 +90,14 @@ class FI {
8890

8991
template<typename R, typename C, typename... Args>
9092
struct FI<R(C::*)(Args...)> {
91-
using r_type = R;
92-
using c_type = C;
93-
94-
static R(*forward(R(*fn)(void* context, Args...)))(void* ctx, Args...) {
95-
return fn;
93+
// a bit ugly as the function pointer is reinterpret_cast
94+
// this assumes void* is ABI compitable with C*
95+
static R(*forward(R(*fn)(C* context, Args...)))(void* ctx, Args...) {
96+
return reinterpret_cast<R(*)(void * context, Args...)>(fn);
9697
}
9798
};
9899

99-
#define STATIC_FORWARD(klass, function) FI<decltype(&klass::function)>::forward([](void* ctx, auto... args) { \
100-
auto that = reinterpret_cast<klass*>(ctx); return that->function(args...); \
100+
// cannot use dynamic_cast because it comes from void*
101+
#define STATIC_FORWARD(function) FI<decltype(&remove_pointer<decltype(this)>::type::function)>::forward([](auto* ctx, auto... args) { \
102+
auto that = reinterpret_cast<decltype(ctx)>((void*)ctx); return that->function(args...); \
101103
})

libswirl/hw/maple/maple_if.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,13 @@ struct MapleDevice : MMIODevice {
220220
//Init registers :)
221221
bool Init()
222222
{
223-
sb->RegisterRIO(this, SB_MDST_addr, RIO_WF, 0, STATIC_FORWARD(MapleDevice, SB_MDST_Write));
223+
sb->RegisterRIO(this, SB_MDST_addr, RIO_WF, 0, STATIC_FORWARD(SB_MDST_Write));
224224

225-
sb->RegisterRIO(this, SB_MDEN_addr, RIO_WF, 0, STATIC_FORWARD(MapleDevice, SB_MDEN_Write));
225+
sb->RegisterRIO(this, SB_MDEN_addr, RIO_WF, 0, STATIC_FORWARD(SB_MDEN_Write));
226226

227-
sb->RegisterRIO(this, SB_MSHTCL_addr, RIO_WF, 0, STATIC_FORWARD(MapleDevice, SB_MSHTCL_Write));
227+
sb->RegisterRIO(this, SB_MSHTCL_addr, RIO_WF, 0, STATIC_FORWARD(SB_MSHTCL_Write));
228228

229-
maple_schid = sh4_sched_register(this, 0, STATIC_FORWARD(MapleDevice, Update));
229+
maple_schid = sh4_sched_register(this, 0, STATIC_FORWARD(Update));
230230

231231
return true;
232232
}

libswirl/hw/modem/modem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ struct ModemDevice_impl : MMIODevice {
314314

315315
bool Init()
316316
{
317-
modem_sched = sh4_sched_register(sh4_cpu, 0, STATIC_FORWARD(ModemDevice_impl, modem_sched_func));
317+
modem_sched = sh4_sched_register(sh4_cpu, 0, STATIC_FORWARD(modem_sched_func));
318318

319319
return true;
320320
}

libswirl/hw/naomi/naomi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,9 @@ struct NaomiDevice_impl : MMIODevice {
525525
#endif
526526
NaomiInit();
527527

528-
sb->RegisterRIO(this, SB_GDST_addr, RIO_WF, 0, STATIC_FORWARD(NaomiDevice_impl, DmaStart));
528+
sb->RegisterRIO(this, SB_GDST_addr, RIO_WF, 0, STATIC_FORWARD(DmaStart));
529529

530-
sb->RegisterRIO(this, SB_GDEN_addr, RIO_WF, 0, STATIC_FORWARD(NaomiDevice_impl, DmaEnable));
530+
sb->RegisterRIO(this, SB_GDEN_addr, RIO_WF, 0, STATIC_FORWARD(DmaEnable));
531531

532532
return true;
533533
}

libswirl/hw/pvr/pvr_sb_regs.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@ struct PVRDevice : MMIODevice {
250250
bool Init()
251251
{
252252
//0x005F7C18 SB_PDST RW PVR-DMA start
253-
sb->RegisterRIO(this, SB_PDST_addr, RIO_WF, 0, STATIC_FORWARD(PVRDevice, SB_PDST_write));
253+
sb->RegisterRIO(this, SB_PDST_addr, RIO_WF, 0, STATIC_FORWARD(SB_PDST_write));
254254

255255
//0x005F6808 SB_C2DST RW ch2-DMA start
256-
sb->RegisterRIO(this, SB_C2DST_addr, RIO_WF, 0, STATIC_FORWARD(PVRDevice, SB_C2DST_write));
256+
sb->RegisterRIO(this, SB_C2DST_addr, RIO_WF, 0, STATIC_FORWARD(SB_C2DST_write));
257257

258258
//0x005F6820 SB_SDST RW Sort-DMA start
259-
sb->RegisterRIO(this, SB_SDST_addr, RIO_WF, 0, STATIC_FORWARD(PVRDevice, SB_SDST_write));
259+
sb->RegisterRIO(this, SB_SDST_addr, RIO_WF, 0, STATIC_FORWARD(SB_SDST_write));
260260

261261
return true;
262262
}

libswirl/hw/pvr/spg.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ struct SPG_impl final : SPG {
286286

287287
bool Init()
288288
{
289-
render_end_schid = sh4_sched_register(this, 0, STATIC_FORWARD(SPG_impl, rend_end_sch));
290-
vblank_schid = sh4_sched_register(this, 0, STATIC_FORWARD(SPG_impl, spg_line_sched));
291-
time_sync = sh4_sched_register(this, 0, STATIC_FORWARD(SPG_impl, elapse_time));
289+
render_end_schid = sh4_sched_register(this, 0, STATIC_FORWARD(rend_end_sch));
290+
vblank_schid = sh4_sched_register(this, 0, STATIC_FORWARD(spg_line_sched));
291+
time_sync = sh4_sched_register(this, 0, STATIC_FORWARD(elapse_time));
292292

293293
sh4_sched_request(time_sync, 8 * 1000 * 1000);
294294

0 commit comments

Comments
 (0)