by RGBA_CRT 2018
using highlight.js
github page
press button
#include
int __cdecl test(int a,int b){
return a+b;
}
int __stdcall test_std(int a,int b){
return a+b;
}
#define funcPtr unsigned int
int __stdcall cdeclLoader(funcPtr func,int *params,unsigned char nParam){
}
int main(){
test(4,2);
test_std(8,96);
}
#include <RGBALib.sbp>
Const SFC_SPEC_HEADER_SIZE=32
Const SFC_SPEC_HEADER_ADDR=&HFFC0
Const HiROM_START_ADR=&HC00000
Const SRAM_ADDRESS_LoROM_NORMAL = &H700000'&H380000
Const SRAM_ADDRESS_LoROM_MAD = &H384000
Const SRAM_ADDRESS_HiROM_NORMAL = &H1C0000
Const SRAM_ADDRESS_HiROM_MAD = &H206000'&HA06000
Const OE = 1
Const CE = 2
Const WE = 4
Const RST= 8
Const SRAM_READ_NOMAL = RST or WE
Const SRAM_READ_MAD = RST or WE or CE
Const SRAM_WRITE_NORMAL=RST or OE
Const SRAM_WRITE_MAD = RST or OE or CE
Const DEFAULT_CTRLBUS = 12
Enum SFC_ROM_TYPE
SFC_ROM_HiROM
SFC_ROM_LoROM
SFC_ROM_ExHiROM
End Enum
Type SFC_ROM_HEADER
Title[21] AS Byte
ROMType As SFC_ROM_TYPE
CartType AS Byte
ROMSize AS DWord
SRAMSize AS DWord
SRAMAddress As DWord
Country AS Byte
Version AS Byte
CheckSum1 AS Word
CheckSum2 AS Word
Mad AS Byte
EndType
'仮想関数を使ってみるテスト
;comment
Class Oya
Public
' VTable[3] AS *Function()
Virtual Sub V()'仮想関数は定義不可
' End Sub
Sub X()
Print "Oya::X"
End Sub
End Class
End Sub
#console
#include
Print "SCSI Eject Test - RGBA_CRT 2018"
Dim drive AS Device
if drive.openFile("\\.\a:",GENERIC_READ or GENERIC_WRITE) = FALSE Then
Print "open error"
end
Endif
if drive.IoCommand(IOCTL_STORAGE_CHECK_VERIFY )=FALSE Then
Print "Disk not inserted!!!"
End
Endif
Print "Disk is available"
if drive.IoCommand(FSCTL_LOCK_VOLUME)=TRUE Then
Print "Device is not using!"
drive.IoCommand( FSCTL_UNLOCK_VOLUME)
Dim yn AS Dword
Input "Eject disk? >",yn
if yn=1 Then
drive.IoCommand(IOCTL_STORAGE_EJECT_MEDIA )
Endif
Else
Print "Drive is busy!"
End
Endif
Print "End"