-
Notifications
You must be signed in to change notification settings - Fork 1
/
SFTurbo.sbp
625 lines (504 loc) · 16.5 KB
/
SFTurbo.sbp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
'-----------------------------------------------------------------------------
' イベント プロシージャ
'-----------------------------------------------------------------------------
' このファイルには、ウィンドウ [SFTurbo] に関するイベントをコーディングします。
' ウィンドウ ハンドル: hSFTurbo
' TODO: この位置にグローバルな変数、構造体、定数、関数を定義します。
Dim SFTW_bMove As BOOL
Dim hFont_InfoBox As HANDLE
Dim crc32 As HashCrc32
'-----------------------------------------------------------------------------
' ウィンドウメッセージを処理するためのコールバック関数
Function SFTurboProc(hWnd As HWND, dwMsg As DWord, wParam As WPARAM, lParam As LPARAM) As DWord
' TODO: この位置にウィンドウメッセージを処理するためのコードを記述します。
' イベントプロシージャの呼び出しを行います。
SFTurboProc=EventCall_SFTurbo(hWnd,dwMsg,wParam,lParam)
End Function
'-----------------------------------------------------------------------------
' ここから下は、イベントプロシージャを記述するための領域になります。
Sub SFTurbo_open()
If hSFTurbo = NULL Then CreateDialog(hMainWnd, "SFTurbo")
MainWnd_Move(0, 0)
SFTW_bMove = FALSE
End Sub
Sub SFTurbo_close()
If hSFTurbo = NULL Then ExitSub
SendMessage(hSFTurbo, WM_CLOSE, 0, 0)
End Sub
Sub SFTurbo_Destroy()
hSFTurbo = NULL
DeleteObject(hFont_InfoBox)
hFont_InfoBox=NULL
End Sub
Sub SFTurbo_Move(x As Integer, y As Integer)
if SFTW_bMove = TRUE Then ExitSub
Dim sfrect As RECT
GetWindowRect(hSFTurbo, sfrect)
Dim mwrect As RECT, mw_width As Long
GetWindowRect(hMainWnd, mwrect)
Dim wndframe_x As Long
wndframe_x = GetSystemMetrics(SM_CXSIZEFRAME) * 2
SFTW_bMove = TRUE
mw_width = mwrect.right - mwrect.left
SetWindowPos(hMainWnd, NULL, sfrect.left - mw_width - wndframe_x, sfrect.top, 0, 0, SWP_NOSIZE or SWP_NOACTIVATE)
SFTW_bMove = FALSE
End Sub
Function SFTWnd(child As Long) As HWND
SFTWnd = GetDlgItem(hSFTurbo, child)
End Function
Function SFTWnd_GetTitleBoxHandle(index As Long) As HWND
Dim SFTWnd_EB_TITLE_TABLE[SFT_SLOT_MAX-1] = [ _
EB_TITLE_A, _
EB_TITLE_B _
] As Long
SFTWnd_GetTitleBoxHandle = GetDlgItem(hSFTurbo, SFTWnd_EB_TITLE_TABLE[index])
End Function
Function SFTWnd_GetRadioButtonHandle(index As Long) As HWND
Dim TABLE[SFT_SLOT_MAX-1] = [ _
RB_SLOT_A, _
RB_SLOT_B _
] As Long
SFTWnd_GetRadioButtonHandle = GetDlgItem(hSFTurbo, TABLE[index])
End Function
Sub SFTWnd_SetTitleBox(index As Long, header As *SFT_ROM_HEADER)
if IsSlotEmpty(header) Then
SetWindowText(SFTWnd_GetTitleBoxHandle(index), "<NOT SLOTTED>")
Else
SetWindowText(SFTWnd_GetTitleBoxHandle(index), header->title)
End If
End Sub
Sub SFTWnd_SetEnable(enable AS BOOL)
EnableWindow(SFTWnd(CommandButton1), enable)
EnableWindow(SFTWnd(CommandButton2), enable)
EnableWindow(SFTWnd(CommandButton3), enable)
EnableWindow(SFTWnd(CommandButton4), enable)
EnableWindow(SFTWnd(RB_SLOT_A), enable)
EnableWindow(SFTWnd(RB_SLOT_B), enable)
EnableWindow(SFTWnd(EB_TITLE_A), enable)
EnableWindow(SFTWnd(EB_TITLE_B), enable)
EnableWindow(SFTWnd(GroupBox1), enable)
EnableWindow(SFTWnd(GroupBox2), enable)
EnableWindow(SFTWnd(EditBox1), enable)
End Sub
Sub SFTurbo_CommandButton1_Click()
Dim outFile As File
Dim index As Long
Dim mmapModel As SFC_MMAP_MODEL, pc As *DumpRomProgressCallBack
Dim header As SFT_ROM_HEADER
Dim path As BytePtr, filter_index As DWord
Dim marged_rom_mode As BOOL
Dim rom As BytePtr, rom_size As DWord
if GetCheckBox(SFTWnd_GetRadioButtonHandle(0)) Then
index=0
Elseif GetCheckBox(SFTWnd_GetRadioButtonHandle(1)) Then
index=1
Else
SetWindowText(SFTWnd(EditBox1), "Please Select SLOT!")
MessageBeep(MB_ICONHAND)
ExitSub
End If
GetSFTurboRomHeader(index, VarPtr(header))
if header.rom_size = 0 Then
DBM("ROM Size is zero.")
ExitFunction
End If
#ifndef _DEBUG
path=SaveDialogCalloc(_
' ex"SFTurboイメージファイル(*.st)\0*.st\0イメージファイル(*.bin)\0*.bin\0SFC ROMイメージファイル(*.sfc)\0*.sfc\0BIOS混合ファイル(*.sfc)\0*.sfc\0すべてのファイル(*.*)\0*.*\0\0",_
ex"SFTurboイメージファイル(*.st)\0*.st\0イメージファイル(*.bin)\0*.bin\0SFC ROMイメージファイル(*.sfc)\0*.sfc\0すべてのファイル(*.*)\0*.*\0\0",_
"st", _
header.title,_
VarPtr(filter_index)
)
'if filter_index = 4 Then marged_rom_mode = TRUE
If path=0 Then ExitSub
#else
path="dump.st"
#endif
if outFile.openFile(path, GENERIC_WRITE) = FALSE Then
DBM("File open error")
#ifndef _DEBUG
free(path)
#endif
ExitFunction
End If
GetSFTurboMmapModel(index, marged_rom_mode, VarPtr(mmapModel))
pc = new_DumpRomProgressCallBack()
if marged_rom_mode Then
DBM("marged_rom_mode")
rom_size = &H400000
Else
rom_size = 128 * 1024 * header.rom_size
End If
SFTWnd_SetEnable(FALSE)
rom = calloc( rom_size )
DumpRom2(hCOM, rom, rom_size, VarPtr(mmapModel), pc)
outFile.write(rom, rom_size)
outFile.close()
dim Hash As DWord
Hash = crc32.GetHash(rom,rom_size)
DBMf(ex"SFTurbo ROM dump successful.\r\nCRC32: %08X", Hash)
free(rom)
#ifndef _DEBUG
free(path)
#endif
SFTWnd_SetEnable(TRUE)
End Sub
Sub SFTurbo_CommandButton2_Click()
Dim outFile As File
Dim index As Long
Dim mmapModel As SFC_MMAP_MODEL, pc As *SramProgressCallBack
Dim header As SFT_ROM_HEADER
Dim path As BytePtr
Dim sram_buf As BytePtr, sram_size As DWord
if GetCheckBox(SFTWnd_GetRadioButtonHandle(0)) Then
index=0
Elseif GetCheckBox(SFTWnd_GetRadioButtonHandle(1)) Then
index=1
Else
SetWindowText(SFTWnd(EditBox1), "Please Select SLOT!")
MessageBeep(MB_ICONHAND)
ExitSub
End If
GetSFTurboRomHeader(index, VarPtr(header))
if header.sram_size = 0 Then
DBM("SRAM size is zero.")
ExitFunction
End If
#ifndef _DEBUG
path=SaveDialogCalloc(ex"SRAMイメージファイル(*.srm)\0*.srm\0すべてのファイル(*.*)\0*.*\0\0","srm",header.title)
If path=0 Then ExitSub
#else
path="dump.sf.sram"
#endif
if outFile.openFile(path, GENERIC_WRITE) = FALSE Then
DBM("File open error")
#ifndef _DEBUG
free(path)
#endif
ExitFunction
End If
GetSFTurboMmapModel(index, FALSE, VarPtr(mmapModel))
pc = new_SramProgressCallBack(VarPtr(mmapModel), FALSE)
sram_size = 2 * 1024 * header.sram_size
sram_buf = calloc( sram_size )
DumpSRAM(hCOM, sram_buf, sram_size, VarPtr(mmapModel), pc)
outFile.write(sram_buf, sram_size)
outFile.close()
free(sram_buf)
#ifndef _DEBUG
free(path)
#endif
DBM(ex"SFTurbo SRAM dump successful.\r\n")
MessageBeep(MB_ICONASTERISK)
End Sub
Sub SFTurbo_CommandButton3_Click()
Dim inFile As File
Dim index As Long
Dim mmapModel As SFC_MMAP_MODEL, pc As *SramProgressCallBack
Dim header As SFT_ROM_HEADER
Dim path As BytePtr
Dim sram_buf As BytePtr, sram_size As DWord
if GetCheckBox(SFTWnd_GetRadioButtonHandle(0)) Then
index=0
Elseif GetCheckBox(SFTWnd_GetRadioButtonHandle(1)) Then
index=1
Else
SetWindowText(SFTWnd(EditBox1), "Please Select SLOT!")
MessageBeep(MB_ICONHAND)
ExitSub
End If
GetSFTurboRomHeader(index, VarPtr(header))
if header.sram_size = 0 Then
DBM("SRAM size is zero.")
ExitFunction
End If
#ifndef _DEBUG
path=SaveDialogCalloc(ex"SRAMイメージファイル(*.srm)\0*.srm\0すべてのファイル(*.*)\0*.*\0\0","srm",header.title)
If path=0 Then ExitSub
#else
path="write.srm"
#endif
if inFile.openFile(path, GENERIC_READ) = FALSE Then
DBM("File open error")
#ifndef _DEBUG
free(path)
#endif
ExitFunction
End If
GetSFTurboMmapModel(index, FALSE, VarPtr(mmapModel))
pc = new_SramProgressCallBack(VarPtr(mmapModel), TRUE)
sram_size = 2 * 1024 * header.sram_size
sram_buf = calloc( sram_size )
inFile.read(sram_buf, sram_size)
inFile.close()
DBM("Writing SRAM...")
WriteSRAM(hCOM, sram_buf, sram_size, VarPtr(mmapModel), pc)
dim verify_buf As BytePtr
verify_buf=calloc(sram_size)
DBMN("Verify...")
DumpSRAM(hCOM, verify_buf, sram_size, VarPtr(mmapModel), NULL)
Dim diffPos AS DWord
if compareBinaly(sram_buf, verify_buf, sram_size, VarPtr(diffPos)) Then
DBM("OK")
DBM(ex"SFTurbo SRAM write successful.\r\n")
MessageBeep(MB_ICONASTERISK)
Else
DBMf(ex"NG at %08Xh", diffPos)
DBM(ex"Failed to write SRAM.\r\n")
printf(ex"=== write ===\n")
Dump(sram_buf+(diffPos And &HFFFFFFF0), 32)
printf(ex"=== actual ===\n")
Dump(verify_buf+(diffPos And &HFFFFFFF0), 32)
MessageBeep(MB_ICONHAND)
End If
free(sram_buf)
free(verify_buf)
#ifndef _DEBUG
free(path)
#endif
End Sub
Sub SFTurbo_CommandButton4_Click()
Dim slot[1] As SFT_ROM_HEADER
Dim i As Long
Dim info As StringClass
for i=0 to SFT_SLOT_MAX-1
if GetSFTurboRomHeader(i,VarPtr(slot[i]))=FALSE Then
ErrMes(hSFTurbo,"ROM io error.",0,0): ExitSub
endif
Dump(VarPtr(slot[i]),sizeof(SFT_ROM_HEADER))
info.sprintf(ex"%s:\r\n", SFT_SLOT_NAME_TABLE[i] As DWord)
SFTurboRomHeaderToStringSimple(VarPtr(info), VarPtr(slot[i]))
info.cat(ex"\r\n")
SetCheckBox(SFTWnd_GetRadioButtonHandle(i), FALSE)
Next
SetWindowText(SFTWnd(EditBox1), info.ptr)
End Sub
Sub OnSelectSlot(index As Long)
Dim slot As SFT_ROM_HEADER
Dim sram As SFT_SRAM_HEADER
if GetSFTurboRomHeader(index,VarPtr(slot))=FALSE Then
ErrMes(hSFTurbo,"ROM I/O ERROR.",0,0): ExitSub
endif
if GetSFTurboSramHeader(index,VarPtr(sram))=FALSE Then
ErrMes(hSFTurbo,"SRAM io error.",0,0): ExitSub
endif
Dump(VarPtr(slot), sizeof(SFT_ROM_HEADER))
Dump(VarPtr(sram), sizeof(SFT_SRAM_HEADER))
'SFTWnd_SetTitleBox(index, VarPtr(slot) )
Dim info As StringClass
info.sprintf(ex"%s Infomation:\r\n", SFT_SLOT_NAME_TABLE[index] As DWord)
SFTurboRomHeaderToString(VarPtr(info), VarPtr(slot) )
SFTurboSramHeaderToString(VarPtr(info), VarPtr(slot), VarPtr(sram) )
SetWindowText(SFTWnd(EditBox1), info.ptr)
End Sub
Sub SFTurbo_RB_SLOT_A_Click()
OnSelectSlot(0)
End Sub
Sub SFTurbo_RB_SLOT_B_Click()
OnSelectSlot(1)
End Sub
Sub SFTurbo_Create(ByRef CreateStruct As CREATESTRUCT)
hFont_InfoBox=CreateFont(-12,0,0,0,400,0,0,0,128,3,2,1,50,"MS Gothic")
SendMessage(SFTWnd(EditBox1),WM_SETFONT,hFont_InfoBox As WPARAM,0)
SFTurbo_CommandButton4_Click()
End Sub
' ==========================================================================================================
/* FROM FULLSNES
00h 14 ID "BANDAI SFC-ADX" (required, compared against 14-byte ID in BIOS)
0Eh 2 Zero-filled
10h 14 Title, padded with spaces (can be 7bit ASCII and 8bit Japanese)
1Eh 2 Zero-filled
20h 2 Entrypoint (in bank 20h) ;game starts here (if it is in Slot A)
22h 2 NMI Vector (in bank 20h) ;if RAM[000000h]=00h: use BIOS NMI handler
24h 2 IRQ Vector (in bank 20h)
26h 2 COP Vector (in bank 20h)
28h 2 BRK Vector (in bank 20h)
2Ah 2 ABT Vector (in bank 20h)
2Ch 4 Zero-filled
30h 3 Unique 24bit ID of a Game (or series of games) (usually 0xh,00h,0yh)
33h 1 Index within a series (01h and up) (eg. 01h..06h for Gundam 1-6)
34h 1 ROM Speed (00h=Slow/2.68Mhz, 01h=Fast=3.58MHz)
35h 1 Chipset/Features (00h=Simple, 01h=SRAM or Linkable?, 03h=Special?)
36h 1 ROM Size in 128Kbyte Units (04h=512K, 08h=1024K)
37h 1 SRAM Size in 2Kbyte Units (00h=None, 01h=2K, 04h=8K)
38h 8 Zero-filled
*/
Const SFT_ROM_OFFSET_SLOT_A = &H200000
Const SFT_ROM_OFFSET_SLOT_B = &H400000
Const SFT_SRAM_OFFSET_SLOT_A = &H600000
Const SFT_SRAM_OFFSET_SLOT_B = &H700000
Type Align(1) SFT_ROM_HEADER
magic[15] As Byte
title[15] As Byte
entry_point As Word
vector_nmi As Word
vector_irq As Word
vector_cop As Word
vector_brk As Word
vector_abt As Word
dummy0 As DWord
game_id As DWord
rom_speed As Byte
chipset As Byte
rom_size As Byte
sram_size As Byte
End Type
Const SFT_ROM_MAGIC = "BANDAI SFC-ADX"
/*
0000h 15 ID "SFC-ADX BACKUP",0 ;Other = begin of free memory
000Fh 1 Zero
0010h 14 Title (same As 0010h..001Dh in ROM Header)
001Eh 1 Zero
001Fh 1 Zero (except, 01h in Poi Poi Ninja)
0020h 4 Unique ID and Index in Series (same As 0030h..0033h in ROM Header)
0024h 1 Filesize (in 2Kbyte units) (same As 0037h in ROM Header)
0025h 11 Zero-filled
*/
Type Align(1) SFT_SRAM_HEADER
magic[15] As Byte
title[15] As Byte
game_id As DWord
file_size As Byte
dummy0[10] As Byte
End Type
Const SFT_SRAM_MAGIC = "SFC-ADX BACKUP"
Const SFT_SLOT_MAX = 2
Dim SFT_ROM_OFFSET_TABLE[SFT_SLOT_MAX] = [ _
SFT_ROM_OFFSET_SLOT_A, _
SFT_ROM_OFFSET_SLOT_B, _
0 _
] As DWord
Dim SFT_SRAM_OFFSET_TABLE[SFT_SLOT_MAX] = [ _
SFT_SRAM_OFFSET_SLOT_A, _
SFT_SRAM_OFFSET_SLOT_B, _
0 _
] As DWord
Dim SFT_SLOT_NAME_TABLE[SFT_SLOT_MAX] = [ _
"Slot A", _
"Slot B", _
"UNDEFINED" _
] As BytePtr
Function GetSFTurboRomHeader(index As Long, header As *SFT_ROM_HEADER) As BOOL
if ReadROM(hCOM,header As BytePtr,0, SFT_ROM_OFFSET_TABLE[index], sizeof(SFT_ROM_HEADER),FALSE)=FALSE Then
GetSFTurboRomHeader=FALSE
Else
GetSFTurboRomHeader=TRUE
End If
SFTWnd_SetTitleBox(index, header)
End Function
Function GetSFTurboSramHeader(index As Long, header As *SFT_SRAM_HEADER) As BOOL
if ReadROM(hCOM,header As BytePtr,0, SFT_SRAM_OFFSET_TABLE[index], sizeof(SFT_SRAM_HEADER),FALSE)=FALSE Then
GetSFTurboSramHeader=FALSE
ExitFunction
End If
GetSFTurboSramHeader=TRUE
End Function
Function IsSlotEmpty(header As *SFT_ROM_HEADER) As BOOL
if lstrcmp(header->magic, SFT_ROM_MAGIC) = 0 then
IsSlotEmpty = FALSE
Else
IsSlotEmpty = TRUE
End If
End Function
Sub SFTurboRomHeaderToString(str As *StringClass, header As *SFT_ROM_HEADER)
if IsSlotEmpty(header) Then
str->cat(ex"- mini cartridge is not inserted.\r\n")
ExitSub
End If
str->sprintf( _
ex"- Magic : %s\r\n- Title : %s\r\n- GameID: %08Xh\r\n - Series No.%d\r\n", _
header->magic As DWord, header->title As DWord, _
ChangeEndianDW2(header->game_id) As DWord, (header->game_id >> 24) As DWord _
)
Dim RomSpeedText As BytePtr
Select Case header->rom_speed
Case 0
RomSpeedText = "Slow/2.68MHz"
Case 1
RomSpeedText = "Fast/3.58MHz"
Case Else
RomSpeedText = "Unknown"
End Select
Dim ChipsetText As BytePtr
Select Case header->chipset
Case 0
ChipsetText = "Simple"
Case 1
ChipsetText = "SRAM or Linkable"
Case 3
ChipsetText = "Special"
Case Else
ChipsetText = "Unknown"
End Select
Dim SramSize[23] As Byte
if header->sram_size = 0 Then
lstrcpy(SramSize,"none")
Else
wsprintf(SramSize,"%3d KB [%2d Kbit]",2*header->sram_size, 16*header->sram_size)
End If
str->sprintf( _
ex"- RomSize : %d KB [%2d Mbit]\r\n- SramSize: %s\r\n- RomSpeed: %02Xh %s\r\n- Chipset : %02Xh %s\r\n", _
128*header->rom_size As DWord,header->rom_size As DWord,_
SramSize As DWord, _
header->rom_speed As DWord, RomSpeedText As DWord,_
header->chipset As DWord, ChipsetText As DWord,_
)
End Sub
Sub SFTurboRomHeaderToStringSimple(str As *StringClass, header As *SFT_ROM_HEADER)
if IsSlotEmpty(header) Then
str->cat(ex"- mini cartridge is not inserted.\r\n")
ExitSub
End If
Dim SramSize[23] As Byte
if header->sram_size = 0 Then
lstrcpy(SramSize,"none")
Else
wsprintf(SramSize,"%dKB",2*header->sram_size)
End If
str->sprintf( _
ex"- Title : %s\r\n- GameID: %08X\r\n- ROM %dKB / SRAM %s\r\n", _
header->title As DWord, _
ChangeEndianDW2(header->game_id) As DWord, _
(128*header->rom_size) As DWord, SramSize As DWord
)
End Sub
Function IsValidSram(header As *SFT_SRAM_HEADER) As BOOL
if lstrcmp(header->magic, SFT_SRAM_MAGIC) = 0 then
IsValidSram = FALSE
Else
IsValidSram = TRUE
End If
End Function
Sub SFTurboSramHeaderToString(str As *StringClass, rom As *SFT_ROM_HEADER, header As *SFT_SRAM_HEADER)
if rom Then
if rom->sram_size = 0 Then
str->cat(ex"- SRAM is none.\r\n")
ExitSub
End If
End If
if IsValidSram(header) Then
str->cat(ex"- SRAM data is broken.\r\n")
ExitSub
End If
str->sprintf(ex"- SramFile: %s (%d KB)\r\n",_
header->title As DWord, _
(2*header->file_size) As DWord
)
End Sub
Function GetSFTurboMmapModel(index As Long, marged_mode As BOOL, model As *SFC_MMAP_MODEL) As BOOL
if marged_mode = FALSE Then
model->rom.adr = SFT_ROM_OFFSET_TABLE[index]
Else
model->rom.adr = LoROM_OFFSET_ADR
End If
model->rom.isLoROM = TRUE
model->rom.init_cb = NULL
model->rom.next_cb = NULL
model->rom.exit_cb = NULL
model->sram.adr = SFT_SRAM_OFFSET_TABLE[index]
model->sram.bankStep = &H010000
model->sram.bankSize = &H008000
model->sram.ctrlBus = CBUS_RST
'BIOS混合に対応するならnextをカスタムしてやる必要がある
End Function