├── .gitattributes
├── .gitignore
├── README.md
├── accessories
├── bin2txt.c
├── bin2txt.dsp
├── bin2txt.dsw
├── lzxpack.c
├── lzxpack.dsp
├── lzxpack.dsw
├── textout.c
└── textout.h
├── android-project
├── AndroidManifest.xml
├── ant.properties
├── build.properties
├── build.xml
├── default.properties
├── jni
│ ├── Android.mk
│ ├── Application.mk
│ └── src
│ │ ├── Android.mk
│ │ ├── Android_static.mk
│ │ ├── compiler.h
│ │ └── main.c
├── proguard-project.txt
├── project.properties
├── res
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── layout
│ │ └── main.xml
│ └── values
│ │ └── strings.xml
└── src
│ ├── com
│ └── yourcompany
│ │ └── np2
│ │ └── Np2Activity.java
│ └── org
│ └── libsdl
│ └── app
│ └── SDLActivity.java
├── bios
├── bios.c
├── bios.h
├── bios09.c
├── bios0c.c
├── bios12.c
├── bios13.c
├── bios18.c
├── bios19.c
├── bios1a.c
├── bios1b.c
├── bios1c.c
├── bios1f.c
├── biosfd80.res
├── biosmem.h
├── fdfmt.h
├── itfrom.res
├── keytable.res
├── rsbios.h
├── startup.res
├── sxsibios.c
└── sxsibios.h
├── break.c
├── break.h
├── calendar.c
├── calendar.h
├── cbus
├── amd98.c
├── amd98.h
├── atapicmd.c
├── atapicmd.h
├── board118.c
├── board118.h
├── board14.c
├── board14.h
├── board26k.c
├── board26k.h
├── board86.c
├── board86.h
├── boardpx.c
├── boardpx.h
├── boardspb.c
├── boardspb.h
├── boardx2.c
├── boardx2.h
├── cbuscore.c
├── cbuscore.h
├── cs4231io.c
├── cs4231io.h
├── idebios.res
├── ideio.c
├── ideio.h
├── mpu98ii.c
├── mpu98ii.h
├── pc9861k.c
├── pc9861k.h
├── pcm86io.c
├── pcm86io.h
├── sasibios.res
├── sasiio.c
├── sasiio.h
├── scsibios.res
├── scsicmd.c
├── scsicmd.h
├── scsiio.c
├── scsiio.h
└── scsiio.tbl
├── codecnv
├── codecnv.h
├── eucsjis.c
├── eucucs2.c
├── sjiseuc.c
├── sjisucs2.c
├── tcswap16.c
├── tcswap32.c
├── textcnv.c
├── textcnv.h
├── ucs2sjis.c
├── ucs2utf8.c
└── utf8ucs2.c
├── common.h
├── common
├── _memory.c
├── _memory.h
├── arc.c
├── arc.h
├── arcunzip.c
├── arcunzip.h
├── bmpdata.c
├── bmpdata.h
├── lstarray.c
├── lstarray.h
├── milstr.c
├── milstr.h
├── mimpidef.c
├── mimpidef.h
├── parts.c
├── parts.h
├── profile.c
├── profile.h
├── rect.c
├── rect.h
├── resize.c
├── resize.h
├── strres.c
├── strres.h
├── textfile.c
├── textfile.h
├── wavefile.c
└── wavefile.h
├── debugsub.c
├── debugsub.h
├── debugsub386.c
├── embed
├── menu
│ ├── dlgabout.c
│ ├── dlgabout.h
│ ├── dlgcfg.c
│ ├── dlgcfg.h
│ ├── dlgscr.c
│ ├── dlgscr.h
│ ├── filesel.c
│ ├── filesel.h
│ ├── menustr.c
│ └── menustr.h
├── menubase
│ ├── menubase.c
│ ├── menubase.h
│ ├── menudeco.inc
│ ├── menudlg.c
│ ├── menudlg.h
│ ├── menuicon.c
│ ├── menuicon.h
│ ├── menumbox.c
│ ├── menumbox.h
│ ├── menures.c
│ ├── menures.h
│ ├── menusys.c
│ ├── menusys.h
│ ├── menuvram.c
│ └── menuvram.h
├── readme.txt
├── vramhdl.c
├── vramhdl.h
├── vrammix.c
└── vrammix.h
├── fdd
├── d88head.h
├── diskdrv.c
├── diskdrv.h
├── fdd_d88.c
├── fdd_d88.h
├── fdd_mtr.c
├── fdd_mtr.h
├── fdd_mtr.res
├── fdd_xdf.c
├── fdd_xdf.h
├── fddfile.c
├── fddfile.h
├── hddboot.res
├── newdisk.c
├── newdisk.h
├── sxsi.c
├── sxsi.h
├── sxsicd.c
├── sxsicd.h
├── sxsihdd.c
└── sxsihdd.h
├── font
├── font.c
├── font.h
├── fontdata.c
├── fontdata.h
├── fontdata.res
├── fontfm7.c
├── fontmake.c
├── fontmake.h
├── fontpc88.c
├── fontpc98.c
├── fontv98.c
├── fontx1.c
├── fontx68k.c
└── readme.txt
├── generic
├── cmjasts.c
├── cmjasts.h
├── cmndraw.c
├── cmndraw.h
├── cmver.c
├── cmver.h
├── dipswbmp.c
├── dipswbmp.h
├── dipswbmp.res
├── hostdrv.c
├── hostdrv.h
├── hostdrv.tbl
├── hostdrvs.c
├── hostdrvs.h
├── keydisp.c
├── keydisp.h
├── keydisp.res
├── memdbg32.c
├── memdbg32.h
├── minifont.res
├── np2info.c
├── np2info.h
├── readme.txt
├── softkbd.c
├── softkbd.h
├── softkbd.res
├── softkbd1.res
├── softkbd2.res
├── softkbd3.res
├── unasm.c
├── unasm.h
├── unasmdef.tbl
├── unasmfpu.tbl
├── unasmop.tbl
├── unasmop3.tbl
├── unasmop8.tbl
└── unasmstr.tbl
├── i286c
├── cpucore.h
├── cpumem.c
├── cpumem.h
├── i286c.c
├── i286c.h
├── i286c.mcr
├── i286c_0f.c
├── i286c_8x.c
├── i286c_ea.c
├── i286c_f6.c
├── i286c_fe.c
├── i286c_mn.c
├── i286c_rp.c
├── i286c_sf.c
├── i286c_sf.mcr
├── v30patch.c
├── v30patch.h
├── x64
│ └── cpucore.inc
└── x86
│ └── cpucore.inc
├── i286x
├── cpucore.h
├── cpucore.inc
├── cpumem.h
├── cpumem.x86
├── i286x.cpp
├── i286x.h
├── i286x.mcr
├── i286xadr.cpp
├── i286xadr.h
├── i286xcts.cpp
├── i286xcts.h
├── i286xea.mcr
├── i286xrep.cpp
├── i286xrep.h
├── i286xs.cpp
├── i286xs.h
├── v30patch.cpp
└── v30patch.h
├── i386c
├── cpucore.c
├── cpucore.h
├── cpumem.c
├── cpumem.h
├── ia32
│ ├── cpu.c
│ ├── cpu.h
│ ├── cpu_io.c
│ ├── cpu_io.h
│ ├── cpu_mem.c
│ ├── cpu_mem.h
│ ├── cpu_mem.mcr
│ ├── ctrlxfer.c
│ ├── ctrlxfer.h
│ ├── debug.c
│ ├── disasm.c
│ ├── exception.c
│ ├── exception.h
│ ├── groups.c
│ ├── groups.h
│ ├── ia32.c
│ ├── ia32.mcr
│ ├── ia32weak.txt
│ ├── ia32xc.mcr
│ ├── ia32xc_msc.mcr
│ ├── inst_table.c
│ ├── inst_table.h
│ ├── instructions
│ │ ├── arith.mcr
│ │ ├── bin_arith.c
│ │ ├── bin_arith.h
│ │ ├── bit_byte.c
│ │ ├── bit_byte.h
│ │ ├── ctrl_trans.c
│ │ ├── ctrl_trans.h
│ │ ├── data_trans.c
│ │ ├── data_trans.h
│ │ ├── dec_arith.c
│ │ ├── dec_arith.h
│ │ ├── flag_ctrl.c
│ │ ├── flag_ctrl.h
│ │ ├── fpu.c
│ │ ├── fpu
│ │ │ ├── fp.h
│ │ │ └── fpdummy.c
│ │ ├── logic_arith.c
│ │ ├── logic_arith.h
│ │ ├── misc_inst.c
│ │ ├── misc_inst.h
│ │ ├── seg_reg.c
│ │ ├── seg_reg.h
│ │ ├── shift_rotate.c
│ │ ├── shift_rotate.h
│ │ ├── shift_rotate.mcr
│ │ ├── shift_rotatexc.mcr
│ │ ├── shift_rotatexc_msc.mcr
│ │ ├── string_inst.c
│ │ ├── string_inst.h
│ │ ├── system_inst.c
│ │ └── system_inst.h
│ ├── interface.c
│ ├── interface.h
│ ├── paging.c
│ ├── paging.h
│ ├── resolve.c
│ ├── resolve.h
│ ├── segments.c
│ ├── segments.h
│ ├── task.c
│ └── task.h
├── x64
│ └── cpucore.inc
└── x86
│ └── cpucore.inc
├── io
├── artic.c
├── artic.h
├── cgrom.c
├── cgrom.h
├── cpuio.c
├── cpuio.h
├── crtc.c
├── crtc.h
├── dipsw.c
├── dipsw.h
├── dmac.c
├── dmac.h
├── egc.c
├── egc.h
├── emsio.c
├── emsio.h
├── epsonio.c
├── epsonio.h
├── fdc.c
├── fdc.h
├── fdd320.c
├── fdd320.h
├── gdc.c
├── gdc.h
├── gdc_cmd.h
├── gdc_cmd.tbl
├── gdc_pset.c
├── gdc_pset.h
├── gdc_sub.c
├── gdc_sub.h
├── iocore.c
├── iocore.h
├── iocore16.tbl
├── lsidef.h
├── mouseif.c
├── mouseif.h
├── necio.c
├── necio.h
├── nmiio.c
├── nmiio.h
├── np2sysp.c
├── np2sysp.h
├── pcidev.c
├── pcidev.h
├── pic.c
├── pic.h
├── pit.c
├── pit.h
├── printif.c
├── printif.h
├── serial.c
├── serial.h
├── sysport.c
├── sysport.h
├── upd4990.c
├── upd4990.h
├── x64
│ └── iocore.inc
└── x86
│ └── iocore.inc
├── keystat.c
├── keystat.h
├── keystat.tbl
├── lio
├── gcircle.c
├── gline.c
├── gpset.c
├── gput1.c
├── gscreen.c
├── lio.c
├── lio.h
└── lio.res
├── mem
├── dmav30.c
├── dmav30.h
├── dmax86.c
├── dmax86.h
├── memegc.c
├── memegc.h
├── memems.c
├── memems.h
├── memepp.c
├── memepp.h
├── memtram.c
├── memtram.h
├── memvga.c
├── memvga.h
├── memvram.c
├── memvram.h
└── x86
│ ├── dmax86.x86
│ └── memegc.x86
├── nevent.c
├── nevent.h
├── np2tool
├── GETBIOS.ASM
├── HOSTDRV.ASM
├── HOSTDRV.INC
├── Makefile.W32
├── NP2TOOL.INC
├── NP2TOOL.X86
├── POWEROFF.COM
├── PWOFF.ASM
└── np2tool.zip
├── np2ver.h
├── pccore.c
├── pccore.h
├── readme.txt
├── romimage
├── BEEP.X86
├── BIOS
│ ├── BIOSFD80.ASM
│ ├── BIOSMAIN.X86
│ ├── EOI.X86
│ ├── VECT02.X86
│ ├── VECT08.X86
│ ├── VECT13.X86
│ ├── VECT1A.X86
│ ├── VECT1F.X86
│ └── vect09.x86
├── DATASEG.INC
├── DEBUG.MAC
├── DIPSW.X86
├── FIRMWARE.X86
├── HDDBOOT.ASM
├── IDEBIOS.ASM
├── ITF.ASM
├── ITF.INC
├── ITF.MK
├── ITFD.MK
├── ITFSUB.X86
├── KEYBOARD.INC
├── KEYBOARD.X86
├── LIO.ASM
├── MAKEFILE.W32
├── MEMCHK.X86
├── MEMSW.X86
├── NP2.X86
├── PC98.INC
├── PROCESS.MAC
├── RESOURCE.TXT
├── SASIBIOS.ASM
├── SCSIBIOS.ASM
├── SSP.X86
├── SSP_DIP.X86
├── SSP_MSW.X86
├── SSP_RES.X86
├── SSP_SUB.X86
├── STARTUP.ASM
├── TEXTDISP.X86
├── readme.txt
└── tool
│ ├── BIN2TXT.C
│ ├── BIN2TXT.LK
│ ├── COMMON.H
│ ├── DOSIO.H
│ ├── DOSIO32.ASM
│ ├── MIL.INC
│ ├── ROMTOOL.MK
│ ├── TXTPACK.C
│ └── TXTPACK.LK
├── sdl2
├── MacOSX
│ ├── np2sdl2.xcodeproj
│ │ └── project.pbxproj
│ └── np2sdl2
│ │ ├── compiler.h
│ │ ├── compiler.pch
│ │ ├── en.lproj
│ │ ├── Credits.rtf
│ │ └── InfoPlist.strings
│ │ ├── main.m
│ │ ├── misc
│ │ ├── guard.h
│ │ ├── threadbase.cpp
│ │ ├── threadbase.h
│ │ ├── tty.cpp
│ │ ├── tty.h
│ │ ├── usbdev.cpp
│ │ └── usbdev.h
│ │ ├── np2.icns
│ │ └── np2sdl2-Info.plist
├── ank10.res
├── ank12.res
├── commng.c
├── commng.h
├── dosio.c
├── dosio.h
├── ext
│ ├── externalchip.h
│ ├── externalchipmanager.cpp
│ ├── externalchipmanager.h
│ ├── externalopna.cpp
│ ├── externalopna.h
│ ├── gimic
│ │ ├── c86boxusb.cpp
│ │ ├── c86boxusb.h
│ │ ├── c86ctl.h
│ │ ├── gimic.cpp
│ │ ├── gimic.h
│ │ ├── gimicusb.cpp
│ │ └── gimicusb.h
│ ├── opna.cpp
│ └── spfm
│ │ ├── spfmlight.cpp
│ │ └── spfmlight.h
├── fontmng.c
├── fontmng.h
├── iOS
│ ├── Default-568h@2x.png
│ ├── Default-Landscape.png
│ ├── Default.png
│ ├── Icon-72.png
│ ├── Icon.png
│ ├── Info.plist
│ ├── compiler.h
│ ├── compiler.pch
│ ├── main.m
│ └── np2sdl2.xcodeproj
│ │ └── project.pbxproj
├── ini.c
├── ini.h
├── inputmng.c
├── inputmng.h
├── joymng.c
├── joymng.h
├── mousemng.c
├── mousemng.h
├── np2.c
├── np2.h
├── oemtext.h
├── scrnmng.c
├── scrnmng.h
├── sdlkbd.c
├── sdlkbd.h
├── soundmng.cpp
├── soundmng.h
├── sysmenu.c
├── sysmenu.h
├── sysmenu.res
├── sysmenu.str
├── sysmng.c
├── sysmng.h
├── taskmng.c
├── taskmng.h
├── timemng.c
├── timemng.h
├── trace.c
├── trace.h
└── win32
│ ├── compiler.c
│ ├── compiler.h
│ ├── main.c
│ ├── misc
│ ├── guard.h
│ ├── threadbase.cpp
│ ├── threadbase.h
│ ├── tty.cpp
│ ├── tty.h
│ ├── usbdev.cpp
│ └── usbdev.h
│ ├── np2sdl2.sln
│ └── np2sdl2.vcproj
├── sound
├── adpcm.h
├── adpcmc.c
├── adpcmg.c
├── beep.h
├── beepc.c
├── beepg.c
├── cs4231.h
├── cs4231c.c
├── cs4231g.c
├── fmboard.c
├── fmboard.h
├── fmtimer.c
├── fmtimer.h
├── getsnd
│ ├── getmp3.c
│ ├── getogg.c
│ ├── getsmix.c
│ ├── getsnd.c
│ ├── getsnd.h
│ ├── getsndmn.mcr
│ ├── getsndst.mcr
│ └── getwave.c
├── opna.c
├── opna.h
├── opngen.h
├── opngenc.c
├── opngeng.c
├── pcm86.h
├── pcm86c.c
├── pcm86g.c
├── pcmmix.c
├── pcmmix.h
├── psggen.h
├── psggenc.c
├── psggeng.c
├── rhythm.h
├── rhythmc.c
├── s98.c
├── s98.h
├── sndcsec.c
├── sndcsec.h
├── sound.c
├── sound.h
├── soundrom.c
├── soundrom.h
├── tms3631.h
├── tms3631c.c
├── tms3631g.c
└── vermouth
│ ├── midimod.c
│ ├── midimod.h
│ ├── midinst.c
│ ├── midinst.h
│ ├── midiout.c
│ ├── midiout.h
│ ├── midtable.c
│ ├── midtable.h
│ ├── midvoice.c
│ ├── midvoice.h
│ └── vermouth.h
├── statsave.c
├── statsave.h
├── statsave.tbl
├── timing.c
├── timing.h
├── trap
├── inttrap.c
├── inttrap.h
├── steptrap.c
└── steptrap.h
├── update.txt
├── vram
├── dispsync.c
├── dispsync.h
├── makegrex.c
├── makegrex.h
├── makegrph.c
├── makegrph.h
├── makegrph.mcr
├── maketext.c
├── maketext.h
├── maketgrp.c
├── maketgrp.h
├── palettes.c
├── palettes.h
├── scrndraw.c
├── scrndraw.h
├── scrnsave.c
├── scrnsave.h
├── sdraw.c
├── sdraw.h
├── sdraw.mcr
├── sdrawex.mcr
├── sdrawq16.c
├── vram.c
└── vram.h
├── win9x
├── cmmidi.cpp
├── cmmidi.h
├── cmpara.cpp
├── cmpara.h
├── cmserial.cpp
├── cmserial.h
├── commng.cpp
├── commng.h
├── compiler.cpp
├── compiler.h
├── dclock.cpp
├── dclock.h
├── dclockd.x86
├── dd2.cpp
├── dd2.h
├── debuguty
│ ├── view1mb.cpp
│ ├── view1mb.h
│ ├── viewasm.cpp
│ ├── viewasm.h
│ ├── viewcmn.cpp
│ ├── viewcmn.h
│ ├── viewer.cpp
│ ├── viewer.h
│ ├── viewmem.cpp
│ ├── viewmem.h
│ ├── viewmenu.cpp
│ ├── viewmenu.h
│ ├── viewpaint.cpp
│ ├── viewpaint.h
│ ├── viewreg.cpp
│ ├── viewreg.h
│ ├── viewseg.cpp
│ ├── viewseg.h
│ ├── viewsnd.cpp
│ ├── viewsnd.h
│ ├── viewstat.cpp
│ ├── viewstat.h
│ ├── viewstk.cpp
│ └── viewstk.h
├── dialog
│ ├── d_about.cpp
│ ├── d_addr.cpp
│ ├── d_bmp.cpp
│ ├── d_clnd.cpp
│ ├── d_config.cpp
│ ├── d_disk.cpp
│ ├── d_edit.cpp
│ ├── d_mpu98.cpp
│ ├── d_screen.cpp
│ ├── d_serial.cpp
│ ├── d_sound.cpp
│ ├── dialog.h
│ ├── dialogs.cpp
│ ├── dialogs.h
│ ├── np2class.cpp
│ └── np2class.h
├── dosio.cpp
├── dosio.h
├── ext
│ ├── c86ctl
│ │ ├── c86ctl.h
│ │ ├── c86ctlif.cpp
│ │ ├── c86ctlif.h
│ │ └── cbus_boardtype.h
│ ├── externalchip.h
│ ├── externalchipmanager.cpp
│ ├── externalchipmanager.h
│ ├── externalopna.cpp
│ ├── externalopna.h
│ ├── mt32snd.cpp
│ ├── mt32snd.h
│ ├── opna.cpp
│ ├── romeo
│ │ ├── juliet.cpp
│ │ ├── juliet.h
│ │ └── romeo.h
│ └── scci
│ │ ├── SCCIDefines.h
│ │ ├── scci.h
│ │ ├── scciif.cpp
│ │ └── scciif.h
├── fontmng.cpp
├── fontmng.h
├── ini.cpp
├── ini.h
├── joymng.cpp
├── joymng.h
├── juliet.cpp
├── menu.cpp
├── menu.h
├── misc
│ ├── extrom.cpp
│ ├── extrom.h
│ ├── guard.h
│ ├── threadbase.cpp
│ ├── threadbase.h
│ ├── tickcounter.cpp
│ ├── tickcounter.h
│ └── vc6macros.h
├── mountdir
│ ├── md_dir.c
│ ├── md_dir.h
│ ├── md_fcb.c
│ ├── md_fcb.h
│ ├── md_file.c
│ ├── md_file.h
│ ├── md_util.c
│ ├── md_util.h
│ ├── mountdir.c
│ └── mountdir.h
├── mousemng.cpp
├── mousemng.h
├── np2.cpp
├── np2.h
├── np21.manifest.xml
├── np21.rc
├── np21.sln
├── np21.vcxproj
├── np21.vcxproj.filters
├── np21base.props
├── np21debug.props
├── np21x64.props
├── np21x86.props
├── np2arg.cpp
├── np2arg.h
├── oemtext.cpp
├── oemtext.h
├── readme.txt
├── recvideo.cpp
├── recvideo.h
├── resource.h
├── resources
│ ├── fddseek.wav
│ ├── fddseek1.wav
│ ├── nekop2.bmp
│ ├── np2.ico
│ ├── np2debug.ico
│ └── np2tool.bmp
├── scrnmng.cpp
├── scrnmng.h
├── soundmng.cpp
├── soundmng.h
├── subwind.cpp
├── subwind.h
├── sysmng.cpp
├── sysmng.h
├── targetver.h
├── taskmng.cpp
├── taskmng.h
├── timemng.cpp
├── timemng.h
├── toolwin.cpp
├── toolwin.h
├── toolwin.res
├── trace.cpp
├── trace.h
├── win32sub.cpp
├── win32sub.h
├── winkbd.cpp
├── winkbd.h
├── winloc.cpp
├── winloc.h
├── x64
│ ├── makegrph.x64
│ ├── parts.x64
│ ├── pccore.inc
│ └── vram.inc
└── x86
│ ├── cputype.h
│ ├── cputype.x86
│ ├── makegrph.x86
│ ├── np2asm.inc
│ ├── opngeng.x86
│ ├── parts.x86
│ ├── pccore.inc
│ ├── vram.inc
│ └── x86.rules
├── x11
├── Makefile.am
├── README.ja
├── autogen.sh
├── cmmidi.c
├── cmmidi.h
├── cmpara.h
├── cmserial.c
├── cmserial.h
├── commng.c
├── commng.h
├── compiler.h
├── configure.ac
├── debug
│ ├── debugwin.h
│ ├── viewer.h
│ ├── viewmem.c
│ └── viewmem.h
├── dosio.c
├── dosio.h
├── drawmng.c
├── drawmng.h
├── fontmng.c
├── fontmng.h
├── gtk2
│ ├── dialog_about.c
│ ├── dialog_calendar.c
│ ├── dialog_config.c
│ ├── dialog_midi.c
│ ├── dialog_newdisk.c
│ ├── dialog_screen.c
│ ├── dialog_sound.c
│ ├── gtk_drawmng.c
│ ├── gtk_drawmng.h
│ ├── gtk_font.c
│ ├── gtk_keyboard.c
│ ├── gtk_keyboard.h
│ ├── gtk_main.c
│ ├── gtk_menu.c
│ ├── gtk_menu.h
│ ├── gtk_mouse.c
│ ├── gtk_screen.c
│ ├── gtk_toolkit.h
│ ├── gtk_wrapper.c
│ ├── window_keydisp.c
│ ├── window_softkbd.c
│ └── xnp2.h
├── ini.c
├── ini.h
├── joymng.c
├── joymng.h
├── kbdmng.c
├── kbdmng.h
├── kdispwin.c
├── kdispwin.h
├── main.c
├── mousemng.h
├── np2.c
├── np2.h
├── oemtext.c
├── oemtext.h
├── resources
│ ├── fddseek.wav
│ ├── fddseek1.wav
│ ├── np2.xbm
│ └── np2.xpm
├── scrnmng.h
├── skbdwin.c
├── skbdwin.h
├── soundmng.c
├── soundmng.h
├── sysmng.c
├── sysmng.h
├── taskmng.c
├── taskmng.h
├── timemng.c
├── timemng.h
├── toolkit.h
├── toolwin.h
├── trace.c
├── trace.h
├── xnp2.jman1
├── xnp2.man1
├── xnp21.jman1
└── xnp21.man1
└── zlib
├── adler32.c
├── crc32.c
├── crc32.h
├── inffast.c
├── inffast.h
├── inffixed.h
├── inflate.c
├── inflate.h
├── inftrees.c
├── inftrees.h
├── readme.txt
├── zconf.h
├── zlib.h
├── zutil.c
└── zutil.h
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Disable LF normalization for all files
2 | * -text
--------------------------------------------------------------------------------
/accessories/bin2txt.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/accessories/bin2txt.dsp
--------------------------------------------------------------------------------
/accessories/bin2txt.dsw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/accessories/bin2txt.dsw
--------------------------------------------------------------------------------
/accessories/lzxpack.dsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/accessories/lzxpack.dsp
--------------------------------------------------------------------------------
/accessories/lzxpack.dsw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/accessories/lzxpack.dsw
--------------------------------------------------------------------------------
/accessories/textout.h:
--------------------------------------------------------------------------------
1 |
2 | void *textout_open(const char *filename, int bufsize);
3 | void textout_write(void *hdl, const char *string);
4 | void textout_close(void *hdl);
5 |
6 |
--------------------------------------------------------------------------------
/android-project/ant.properties:
--------------------------------------------------------------------------------
1 | # This file is used to override default values used by the Ant build system.
2 | #
3 | # This file must be checked into Version Control Systems, as it is
4 | # integral to the build system of your project.
5 |
6 | # This file is only used by the Ant script.
7 |
8 | # You can use this to override default values such as
9 | # 'source.dir' for the location of your java source folder and
10 | # 'out.dir' for the location of your output folder.
11 |
12 | # You can also use it define how the release builds are signed by declaring
13 | # the following properties:
14 | # 'key.store' for the location of your keystore and
15 | # 'key.alias' for the name of the key to use.
16 | # The password will be asked during the build when you use the 'release' target.
17 |
18 |
--------------------------------------------------------------------------------
/android-project/build.properties:
--------------------------------------------------------------------------------
1 | # This file is used to override default values used by the Ant build system.
2 | #
3 | # This file must be checked in Version Control Systems, as it is
4 | # integral to the build system of your project.
5 |
6 | # This file is only used by the Ant script.
7 |
8 | # You can use this to override default values such as
9 | # 'source.dir' for the location of your java source folder and
10 | # 'out.dir' for the location of your output folder.
11 |
12 | # You can also use it define how the release builds are signed by declaring
13 | # the following properties:
14 | # 'key.store' for the location of your keystore and
15 | # 'key.alias' for the name of the key to use.
16 | # The password will be asked during the build when you use the 'release' target.
17 |
18 |
--------------------------------------------------------------------------------
/android-project/default.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system use,
7 | # "build.properties", and override values to adapt the script to your
8 | # project structure.
9 |
10 | # Project target.
11 | target=android-12
12 |
--------------------------------------------------------------------------------
/android-project/jni/Android.mk:
--------------------------------------------------------------------------------
1 | include $(call all-subdir-makefiles)
2 |
--------------------------------------------------------------------------------
/android-project/jni/Application.mk:
--------------------------------------------------------------------------------
1 |
2 | # Uncomment this if you're using STL in your project
3 | # See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information
4 | APP_STL := stlport_static
5 |
6 | # APP_ABI := armeabi armeabi-v7a x86
7 | APP_ABI := armeabi-v7a
8 |
--------------------------------------------------------------------------------
/android-project/jni/src/Android_static.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := main
6 |
7 | LOCAL_SRC_FILES := YourSourceHere.c
8 |
9 | LOCAL_STATIC_LIBRARIES := SDL2_static
10 |
11 | include $(BUILD_SHARED_LIBRARY)
12 | $(call import-module,SDL)LOCAL_PATH := $(call my-dir)
13 |
--------------------------------------------------------------------------------
/android-project/jni/src/main.c:
--------------------------------------------------------------------------------
1 | /*
2 | * @file main.c
3 | */
4 |
5 | #include "compiler.h"
6 | #include "dosio.h"
7 | #include "np2.h"
8 |
9 | int SDL_main(int argc, char *argv[])
10 | {
11 | file_setcd("/sdcard/application/np2/");
12 | return np2_main(argc, argv);
13 | }
14 |
--------------------------------------------------------------------------------
/android-project/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/android-project/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 |
--------------------------------------------------------------------------------
/android-project/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/android-project/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android-project/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/android-project/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Neko Project II
4 |
5 |
--------------------------------------------------------------------------------
/android-project/src/com/yourcompany/np2/Np2Activity.java:
--------------------------------------------------------------------------------
1 | package com.yourcompany.np2;
2 | import org.libsdl.app.SDLActivity;
3 | /*
4 | * A sample wrapper class that just calls SDLActivity
5 | */
6 | public class Np2Activity extends SDLActivity
7 | {
8 | }
9 |
--------------------------------------------------------------------------------
/bios/bios1c.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "parts.h"
3 | #include "timemng.h"
4 | #include "cpucore.h"
5 | #include "pccore.h"
6 | #include "iocore.h"
7 | #include "calendar.h"
8 | #include "bios.h"
9 | #include "biosmem.h"
10 |
11 |
12 | void bios0x1c(void) {
13 |
14 | UINT8 buf[6];
15 |
16 | switch(CPU_AH) {
17 | case 0x00: // get system timer
18 | calendar_get(buf);
19 | MEMR_WRITES(CPU_ES, CPU_BX, buf, 6);
20 | break;
21 |
22 | case 0x01: // put system timer
23 | MEMR_READS(CPU_ES, CPU_BX, buf, 6);
24 | mem[MEMB_MSW8] = buf[0];
25 | calendar_set(buf);
26 | break;
27 |
28 | case 0x02: // set interval timer (single)
29 | SETBIOSMEM16(0x0001c, CPU_BX);
30 | SETBIOSMEM16(0x0001e, CPU_ES);
31 | SETBIOSMEM16(0x0058a, CPU_CX);
32 | iocore_out8(0x77, 0x36);
33 | /*FALLTHROUGH*/
34 |
35 | case 0x03: // continue interval timer
36 | iocore_out8(0x71, 0x00);
37 | if (pccore.cpumode & CPUMODE_8MHZ) {
38 | iocore_out8(0x71, 0x4e); // 4MHz
39 | }
40 | else {
41 | iocore_out8(0x71, 0x60); // 5MHz
42 | }
43 | pic.pi[0].imr &= ~(PIC_SYSTEMTIMER);
44 | break;
45 | }
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/bios/fdfmt.h:
--------------------------------------------------------------------------------
1 |
2 | static const UINT8 fdfmt144[] = { // ver0.31
3 | // MFM R/W MFM FMT FM R/W FM FMT
4 | // EOT GPL SC GPL EOT GPL SC GPL
5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7 | 0x12, 0x1b, 0x12, 0x54, 0x00, 0x00, 0x00, 0x00,
8 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
9 |
10 | static const UINT8 fdfmt2hd[] = {
11 | // MFM R/W MFM FMT FM R/W FM FMT
12 | // EOT GPL SC GPL EOT GPL SC GPL
13 | 0x00, 0x00, 0x00, 0x00, 0x1a, 0x07, 0x1a, 0x1b,
14 | 0x1a, 0x0e, 0x1a, 0x36, 0x0f, 0x0e, 0x0f, 0x2a,
15 | 0x0f, 0x1b, 0x0f, 0x50, 0x08, 0x1b, 0x08, 0x3a,
16 | 0x08, 0x35, 0x08, 0x74, 0x00, 0x00, 0x00, 0x00};
17 |
18 | static const UINT8 fdfmt2dd[] = {
19 | // MFM R/W MFM FMT FM R/W FM FMT
20 | // EOT GPL SC GPL EOT GPL SC GPL
21 | 0x00, 0x00, 0x00, 0x00, 0x10, 0x07, 0x10, 0x1b,
22 | 0x10, 0x0e, 0x10, 0x36, 0x09, 0x0e, 0x09, 0x2a,
23 | 0x09, 0x2a, 0x09, 0x50, 0x05, 0x1b, 0x05, 0x3a,
24 | 0x05, 0x35, 0x05, 0x74, 0x00, 0x00, 0x00, 0x00};
25 |
26 |
--------------------------------------------------------------------------------
/bios/keytable.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/bios/keytable.res
--------------------------------------------------------------------------------
/bios/rsbios.h:
--------------------------------------------------------------------------------
1 | // BIOS0C.CPP, BIOS19.CPP
2 |
3 | enum {
4 | R_INT = 0x00,
5 | R_BFLG = 0x01,
6 | R_FLAG = 0x02,
7 | R_CMD = 0x03,
8 | R_STIME = 0x04,
9 | R_RTIME = 0x05,
10 | R_XOFF = 0x06,
11 | R_XON = 0x08,
12 | R_HEADP = 0x0a,
13 | R_TAILP = 0x0c,
14 | R_CNT = 0x0e,
15 | R_PUTP = 0x10,
16 | R_GETP = 0x12,
17 |
18 | RINT_INT = 0x80,
19 |
20 | RFLAG_INIT = 0x80,
21 | RFLAG_BFULL = 0x40,
22 | RFLAG_BOVF = 0x20,
23 | RFLAG_XON = 0x10,
24 | RFLAG_XOFF = 0x08,
25 |
26 | RCMD_IR = 0x40,
27 | RCMD_RTS = 0x20,
28 | RCMD_ER = 0x10,
29 | RCMD_SBRK = 0x08,
30 | RCMD_RXE = 0x04,
31 | RCMD_DTR = 0x02,
32 | RCMD_TXEN = 0x01,
33 |
34 | RSCODE_XON = 0x11,
35 | RSCODE_XOFF = 0x13,
36 | RSCODE_SO = 0x0e,
37 | RSCODE_SI = 0x0f
38 | };
39 |
40 | typedef struct {
41 | UINT8 INT; // + 0
42 | UINT8 BFLG; // + 1
43 | UINT8 FLAG; // + 2
44 | UINT8 CMD; // + 3
45 | UINT8 STIME; // + 4
46 | UINT8 RTIME; // + 5
47 | UINT8 XOFF[2]; // + 6
48 | UINT8 XON[2]; // + 8
49 | UINT8 HEADP[2]; // + a
50 | UINT8 TAILP[2]; // + c
51 | UINT8 CNT[2]; // + e
52 | UINT8 PUTP[2]; // +10
53 | UINT8 GETP[2]; // +12
54 | } RSBIOS;
55 |
56 |
--------------------------------------------------------------------------------
/bios/startup.res:
--------------------------------------------------------------------------------
1 |
2 | static const UINT8 nosyscode[] = {
3 | 0xeb,0x05,0xbe,0x5f,0x00,0xeb,0x03,0xbe,0x37,0x00,0xb8,0x04,
4 | 0x0a,0xcd,0x18,0xb4,0x0c,0xcd,0x18,0xb4,0x16,0xba,0x20,0xe1,
5 | 0xcd,0x18,0xfa,0xfc,0xb8,0x00,0xa0,0x8e,0xc0,0x2e,0xad,0x89,
6 | 0xc7,0x2e,0xad,0x85,0xc0,0x74,0x09,0xab,0x08,0xe4,0x74,0xf5,
7 | 0x47,0x47,0xeb,0xf1,0xf4,0xeb,0xfd,0xac,0x07,0x05,0x37,0x05,
8 | 0x39,0x05,0x46,0x05,0x60,0x05,0x47,0x05,0x23,0x05,0x39,0x05,
9 | 0x2f,0x04,0x72,0x05,0x3b,0x05,0x43,0x05,0x48,0x04,0x37,0x04,
10 | 0x46,0x04,0x2f,0x04,0x40,0x04,0x35,0x04,0x24,0x00,0x00,0xae,
11 | 0x07,0x42,0x00,0x41,0x00,0x53,0x00,0x49,0x00,0x43,0x00,0x04,
12 | 0x4e,0x15,0x2f,0x26,0x30,0x04,0x4b,0x04,0x4f,0x20,0x00,0x42,
13 | 0x00,0x49,0x00,0x4f,0x00,0x53,0x00,0x2e,0x00,0x52,0x00,0x4f,
14 | 0x00,0x4d,0x00,0x04,0x2c,0x29,0x2c,0x2d,0x57,0x04,0x47,0x04,
15 | 0x39,0x00,0x00,
16 | };
17 |
--------------------------------------------------------------------------------
/bios/sxsibios.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file sxsibios.h
3 | * @brief Interface of SxSI BIOS
4 | */
5 |
6 | #pragma once
7 |
8 | enum {
9 | SXSIBIOS_SASI = 0,
10 | SXSIBIOS_IDE = 1,
11 | SXSIBIOS_SCSI = 2
12 | };
13 |
14 | #ifdef __cplusplus
15 | extern "C" {
16 | #endif
17 |
18 | REG8 sasibios_operate(void);
19 |
20 | #if defined(SUPPORT_SCSI)
21 | REG8 scsibios_operate(void);
22 | #endif
23 |
24 | #if defined(SUPPORT_IDEIO) || defined(SUPPORT_SASI)
25 | void np2sysp_sasi(const void *arg1, long arg2);
26 | #endif
27 |
28 | #if defined(SUPPORT_SCSI)
29 | void np2sysp_scsi(const void *arg1, long arg2);
30 | void np2sysp_scsidev(const void *arg1, long arg2);
31 | #endif
32 |
33 | #ifdef __cplusplus
34 | }
35 | #endif
36 |
--------------------------------------------------------------------------------
/calendar.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | _SYSTIME dt;
4 | _SYSTIME realc;
5 | UINT steps;
6 | UINT realchg;
7 | } _CALENDAR, *CALENDAR;
8 |
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | extern _CALENDAR cal;
15 |
16 | void calendar_initialize(void);
17 | void calendar_inc(void);
18 | void calendar_set(const UINT8 *bcd);
19 | void calendar_get(UINT8 *bcd);
20 | void calendar_getreal(UINT8 *bcd);
21 | void calendar_getvir(UINT8 *bcd);
22 |
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 |
27 |
--------------------------------------------------------------------------------
/cbus/amd98.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file amd98.h
3 | * @brief Interface of AMD-98
4 | */
5 |
6 | #pragma once
7 |
8 | #include "pccore.h"
9 | #include "statsave.h"
10 | #include "sound/psggen.h"
11 |
12 | /**
13 | * @breif The sturecture of AMD-98
14 | */
15 | struct amd98_t
16 | {
17 | struct
18 | {
19 | UINT8 psg1reg;
20 | UINT8 psg2reg;
21 | UINT8 psg3reg;
22 | UINT8 rhythm;
23 | } s;
24 | _PSGGEN psg[3];
25 | };
26 |
27 | typedef struct amd98_t AMD98;
28 |
29 | #ifdef __cplusplus
30 | extern "C"
31 | {
32 | #endif
33 |
34 | extern AMD98 g_amd98;
35 |
36 | void amd98_initialize(UINT rate);
37 | void amd98_deinitialize(void);
38 |
39 | void amd98int(NEVENTITEM item);
40 |
41 | void amd98_reset(const NP2CFG *pConfig);
42 | void amd98_bind(void);
43 |
44 | int amd98_sfsave(STFLAGH sfh, const SFENTRY *tbl);
45 | int amd98_sfload(STFLAGH sfh, const SFENTRY *tbl);
46 |
47 | #ifdef __cplusplus
48 | }
49 | #endif
50 |
51 |
--------------------------------------------------------------------------------
/cbus/board118.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file board118.h
3 | * @brief Interface of PC-9801-118
4 | */
5 |
6 | #pragma once
7 |
8 | #include "pccore.h"
9 |
10 | #ifdef __cplusplus
11 | extern "C"
12 | {
13 | #endif
14 |
15 | void board118_reset(const NP2CFG *pConfig);
16 | void board118_bind(void);
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 |
--------------------------------------------------------------------------------
/cbus/board14.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file board14.h
3 | * @brief Interface of PC-9801-14
4 | */
5 |
6 | #pragma once
7 |
8 | /**
9 | * @breif The sturecture of PC-9801-14
10 | */
11 | struct musicgen_t
12 | {
13 | UINT8 porta;
14 | UINT8 portb;
15 | UINT8 portc;
16 | UINT8 mask;
17 | UINT8 key[8];
18 | int sync;
19 | int ch;
20 | };
21 |
22 | typedef struct musicgen_t MUSICGEN;
23 |
24 | #ifdef __cplusplus
25 | extern "C"
26 | {
27 | #endif
28 |
29 | extern MUSICGEN g_musicgen;
30 |
31 | void musicgenint(NEVENTITEM item);
32 | UINT board14_pitcount(void);
33 |
34 | void board14_allkeymake(void);
35 |
36 | void board14_reset(const NP2CFG *pConfig, BOOL bEnable);
37 | void board14_bind(void);
38 |
39 | #ifdef __cplusplus
40 | }
41 | #endif
42 |
--------------------------------------------------------------------------------
/cbus/board26k.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file board26k.h
3 | * @brief Interface of PC-9801-26K
4 | */
5 |
6 | #pragma once
7 |
8 | #include "pccore.h"
9 |
10 | #ifdef __cplusplus
11 | extern "C"
12 | {
13 | #endif
14 |
15 | void board26k_reset(const NP2CFG *pConfig);
16 | void board26k_bind(void);
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 |
--------------------------------------------------------------------------------
/cbus/board86.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file board86.h
3 | * @brief Interface of PC-9801-86
4 | */
5 |
6 | #pragma once
7 |
8 | #include "pccore.h"
9 |
10 | #ifdef __cplusplus
11 | extern "C"
12 | {
13 | #endif
14 |
15 | void board86_reset(const NP2CFG *pConfig, BOOL adpcm);
16 | void board86_bind(void);
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 |
--------------------------------------------------------------------------------
/cbus/boardpx.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file boardpx.h
3 | * @brief Interface of PX
4 | */
5 |
6 | #pragma once
7 |
8 | #if defined(SUPPORT_PX)
9 |
10 | #include "pccore.h"
11 |
12 | #ifdef __cplusplus
13 | extern "C"
14 | {
15 | #endif
16 |
17 | void boardpx1_reset(const NP2CFG *pConfig);
18 | void boardpx1_bind(void);
19 |
20 | void boardpx2_reset(const NP2CFG *pConfig);
21 | void boardpx2_bind(void);
22 |
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 |
27 | #endif // defined(SUPPORT_PX)
28 |
--------------------------------------------------------------------------------
/cbus/boardspb.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file boardspb.h
3 | * @brief Interface of Speak board
4 | */
5 |
6 | #pragma once
7 |
8 | #include "pccore.h"
9 |
10 | #ifdef __cplusplus
11 | extern "C"
12 | {
13 | #endif
14 |
15 | void boardspb_reset(const NP2CFG *pConfig);
16 | void boardspb_bind(void);
17 |
18 | void boardspr_reset(const NP2CFG *pConfig);
19 | void boardspr_bind(void);
20 |
21 | #ifdef __cplusplus
22 | }
23 | #endif
24 |
--------------------------------------------------------------------------------
/cbus/boardx2.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file boardx2.h
3 | * @brief Interface of PC-9801-86 + 26K
4 | */
5 |
6 | #pragma once
7 |
8 | #include "pccore.h"
9 |
10 | #ifdef __cplusplus
11 | extern "C"
12 | {
13 | #endif
14 |
15 | void boardx2_reset(const NP2CFG *pConfig);
16 | void boardx2_bind(void);
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 |
--------------------------------------------------------------------------------
/cbus/cbuscore.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void cbuscore_reset(const NP2CFG *pConfig);
7 | void cbuscore_bind(void);
8 |
9 | void cbuscore_attachsndex(UINT port, const IOOUT *out, const IOINP *inp);
10 |
11 | #ifdef __cplusplus
12 | }
13 | #endif
14 |
15 |
--------------------------------------------------------------------------------
/cbus/cs4231io.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ifdef __cplusplus
4 | extern "C" {
5 | #endif
6 |
7 | void cs4231io_reset(void);
8 | void cs4231io_bind(void);
9 |
10 | void IOOUTCALL cs4231io0_w8(UINT port, REG8 value);
11 | REG8 IOINPCALL cs4231io0_r8(UINT port);
12 | void IOOUTCALL cs4231io2_w8(UINT port, REG8 value);
13 | REG8 IOINPCALL cs4231io2_r8(UINT port);
14 | void IOOUTCALL cs4231io5_w8(UINT port, REG8 value);
15 | REG8 IOINPCALL cs4231io5_r8(UINT port);
16 |
17 | #ifdef __cplusplus
18 | }
19 | #endif
20 |
21 |
--------------------------------------------------------------------------------
/cbus/idebios.res:
--------------------------------------------------------------------------------
1 |
2 | static const UINT8 idebios[] = {
3 | 0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,0x55,0xaa,0x02,
4 | 0xeb,0x22,0x90,0xeb,0x23,0x90,0xcb,0x90,0x90,0xeb,0x50,0x90,
5 | 0xeb,0x2f,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,
6 | 0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,
7 | 0xc6,0x07,0xd9,0xcb,0x8c,0xc8,0x80,0x0e,0x80,0x04,0x80,0x88,
8 | 0x26,0xb0,0x04,0x88,0x26,0xb8,0x04,0xb8,0x00,0x03,0xcd,0x1b,
9 | 0xcb,0xfc,0x8c,0xca,0x8e,0xda,0xb9,0x08,0x00,0xbe,0x9a,0x00,
10 | 0xba,0xef,0x07,0xfa,0xac,0xee,0xe2,0xfc,0xfb,0x58,0x5b,0x59,
11 | 0x5a,0x5d,0x07,0x5f,0x5e,0x1f,0xcf,0x3c,0x0a,0x74,0x05,0x3c,
12 | 0x0b,0x74,0x01,0xcb,0x2c,0x09,0x84,0x06,0x5d,0x05,0x74,0x21,
13 | 0xfe,0xc8,0xb4,0x06,0xb9,0xc0,0x1f,0x8e,0xc1,0x31,0xdb,0x89,
14 | 0xdd,0x89,0xd9,0x89,0xda,0xb7,0x04,0xcd,0x1b,0x72,0x0a,0x0c,
15 | 0x80,0xa2,0x84,0x05,0x9a,0x00,0x00,0xc0,0x1f,0xcb,0x73,0x61,
16 | 0x73,0x69,0x62,0x69,0x6f,0x73,
17 | };
18 |
19 |
--------------------------------------------------------------------------------
/cbus/pc9861k.h:
--------------------------------------------------------------------------------
1 |
2 | #if !defined(SUPPORT_PC9861K)
3 |
4 | #define pc9861k_initialize()
5 | #define pc9861k_deinitialize()
6 | #define pc9861k_midipanic()
7 |
8 | #else
9 |
10 | typedef struct {
11 | UINT8 result;
12 | UINT8 data;
13 | UINT8 signal;
14 | UINT8 send;
15 |
16 | UINT pos;
17 | UINT dummyinst;
18 | UINT32 speed;
19 | SINT32 clk;
20 |
21 | UINT8 dip;
22 | UINT8 vect;
23 | UINT8 irq;
24 | } _PC9861CH, *PC9861CH;
25 |
26 | typedef struct {
27 | _PC9861CH ch1;
28 | _PC9861CH ch2;
29 | BOOL en;
30 | } _PC9861K, *PC9861K;
31 |
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif
36 |
37 | extern const UINT32 pc9861k_speed[11];
38 | extern _PC9861K pc9861k;
39 |
40 | void pc9861ch1cb(NEVENTITEM item);
41 | void pc9861ch2cb(NEVENTITEM item);
42 |
43 | void pc9861k_initialize(void);
44 | void pc9861k_deinitialize(void);
45 |
46 | void pc9861k_reset(const NP2CFG *pConfig);
47 | void pc9861k_bind(void);
48 |
49 | void pc9861k_midipanic(void);
50 |
51 | #ifdef __cplusplus
52 | }
53 | #endif
54 |
55 | #endif
56 |
57 |
--------------------------------------------------------------------------------
/cbus/pcm86io.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ifdef __cplusplus
4 | extern "C" {
5 | #endif
6 |
7 | void pcm86io_bind(void);
8 |
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/cbus/sasibios.res:
--------------------------------------------------------------------------------
1 |
2 | static const UINT8 sasibios[] = {
3 | 0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,0x55,0xaa,0x02,
4 | 0xeb,0x22,0x90,0xeb,0x23,0x90,0xcb,0x90,0x90,0xeb,0x54,0x90,
5 | 0xeb,0x33,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,
6 | 0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,
7 | 0xc6,0x07,0xd9,0xcb,0x8c,0xc8,0xc7,0x06,0x44,0x00,0x9d,0x00,
8 | 0xa3,0x46,0x00,0x88,0x26,0xb0,0x04,0x88,0x26,0xb8,0x04,0xb8,
9 | 0x00,0x03,0xcd,0x1b,0xcb,0xfc,0x8c,0xca,0x8e,0xda,0xb9,0x08,
10 | 0x00,0xbe,0xcf,0x00,0xba,0xef,0x07,0xfa,0xac,0xee,0xe2,0xfc,
11 | 0xfb,0x58,0x5b,0x59,0x5a,0x5d,0x07,0x5f,0x5e,0x1f,0xcf,0x3c,
12 | 0x0a,0x74,0x05,0x3c,0x0b,0x74,0x01,0xcb,0x2c,0x09,0x84,0x06,
13 | 0x5d,0x05,0x74,0x20,0xfe,0xc8,0xb4,0x06,0xb9,0xc0,0x1f,0x8e,
14 | 0xc1,0x31,0xed,0xbb,0x00,0x04,0x31,0xc9,0x31,0xd2,0xcd,0x1b,
15 | 0x72,0x0a,0x0c,0x80,0xa2,0x84,0x05,0x9a,0x00,0x00,0xc0,0x1f,
16 | 0xcb,0x50,0xe4,0x82,0x24,0xfd,0x3c,0xad,0x74,0x06,0x24,0xf9,
17 | 0x3c,0xa1,0x75,0x0f,0x1e,0x31,0xc0,0x8e,0xd8,0x80,0x0e,0x5f,
18 | 0x05,0x01,0xb0,0xc0,0xe6,0x82,0x1f,0xb0,0x20,0xe6,0x08,0xb0,
19 | 0x0b,0xe6,0x08,0xe4,0x08,0x84,0xc0,0x75,0x04,0xb0,0x20,0xe6,
20 | 0x00,0x58,0xcf,0x73,0x61,0x73,0x69,0x62,0x69,0x6f,0x73,
21 | };
22 |
23 |
--------------------------------------------------------------------------------
/cbus/sasiio.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(SUPPORT_SASI)
3 |
4 | typedef struct {
5 | UINT8 phase;
6 | UINT8 ocr;
7 | UINT8 stat;
8 | UINT8 error;
9 | UINT8 unit;
10 | UINT8 isrint;
11 | UINT8 cmd[6];
12 | UINT cmdpos;
13 | UINT8 sens[4];
14 | UINT senspos;
15 | UINT c2pos;
16 | UINT32 sector;
17 | UINT blocks;
18 | UINT datpos;
19 | UINT datsize;
20 | UINT8 dat[256];
21 | } _SASIIO, *SASIIO;
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | extern _SASIIO sasiio;
28 |
29 | void sasiioint(NEVENTITEM item);
30 |
31 | REG8 DMACCALL sasi_dmafunc(REG8 func);
32 | REG8 DMACCALL sasi_dataread(void);
33 | void DMACCALL sasi_datawrite(REG8 data);
34 |
35 | void sasiio_reset(const NP2CFG *pConfig);
36 | void sasiio_bind(void);
37 |
38 | #ifdef __cplusplus
39 | }
40 | #endif
41 |
42 | #endif
43 |
44 |
--------------------------------------------------------------------------------
/cbus/scsibios.res:
--------------------------------------------------------------------------------
1 |
2 | static const UINT8 scsibios[] = {
3 | 0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,0x55,0xaa,0x02,
4 | 0xeb,0x22,0x90,0xeb,0x24,0x90,0xcb,0x90,0x90,0xeb,0x59,0x90,
5 | 0xeb,0x2f,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,
6 | 0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,0xcb,0x90,0x90,
7 | 0xc7,0x07,0xc2,0x82,0xcb,0x8c,0xc8,0x88,0x26,0xb2,0x04,0x88,
8 | 0x26,0xba,0x04,0x88,0x26,0xbc,0x04,0xb8,0x20,0x03,0xcd,0x1b,
9 | 0xcb,0xfc,0x8c,0xca,0x8e,0xda,0xb9,0x08,0x00,0xbe,0x94,0x00,
10 | 0xf6,0x46,0x00,0x40,0x74,0x03,0x8d,0x74,0x08,0xba,0xef,0x07,
11 | 0xfa,0xac,0xee,0xe2,0xfc,0xfb,0x58,0x5b,0x59,0x5a,0x5d,0x07,
12 | 0x5f,0x5e,0x1f,0xcf,0x3c,0x0c,0x75,0x1f,0xb8,0x20,0x46,0xb9,
13 | 0xc0,0x1f,0x8e,0xc1,0x31,0xed,0xbb,0x00,0x04,0x31,0xc9,0x31,
14 | 0xd2,0xcd,0x1b,0x72,0x0a,0x0c,0x80,0xa2,0x84,0x05,0x9a,0x00,
15 | 0x00,0xc0,0x1f,0xcb,0x73,0x63,0x73,0x69,0x62,0x69,0x6f,0x73,
16 | 0x73,0x63,0x73,0x69,0x5f,0x64,0x65,0x76,
17 | };
18 |
19 |
--------------------------------------------------------------------------------
/cbus/scsicmd.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(SUPPORT_SCSI)
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | REG8 scsicmd_negate(REG8 id);
9 | REG8 scsicmd_select(REG8 id);
10 | REG8 scsicmd_transfer(REG8 id, UINT8 *cdb);
11 | BRESULT scsicmd_send(void);
12 |
13 | void scsicmd_bios(void);
14 |
15 | #ifdef __cplusplus
16 | }
17 | #endif
18 |
19 | #endif
20 |
21 |
--------------------------------------------------------------------------------
/cbus/scsiio.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(SUPPORT_SCSI)
3 |
4 | typedef struct {
5 | UINT port;
6 | UINT phase;
7 | UINT8 reg[0x30];
8 | UINT8 auxstatus;
9 | UINT8 scsistatus;
10 | UINT8 membank;
11 | UINT8 memwnd;
12 | UINT8 resent;
13 | UINT8 datmap;
14 | UINT cmdpos;
15 | UINT wrdatpos;
16 | UINT rddatpos;
17 | UINT8 cmd[12];
18 | UINT8 data[0x10000];
19 | UINT8 bios[2][0x2000];
20 | } _SCSIIO, *SCSIIO;
21 |
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | extern _SCSIIO scsiio;
28 |
29 | void scsiioint(NEVENTITEM item);
30 |
31 | void scsiio_reset(const NP2CFG *pConfig);
32 | void scsiio_bind(void);
33 |
34 | #ifdef __cplusplus
35 | }
36 | #endif
37 |
38 | #endif
39 |
40 |
--------------------------------------------------------------------------------
/codecnv/tcswap16.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "textcnv.h"
3 |
4 |
5 | void textcnv_swapendian16(void *buf, UINT leng) {
6 |
7 | UINT8 *p;
8 | UINT8 tmp;
9 |
10 | p = (UINT8 *)buf;
11 | while(leng) {
12 | tmp = p[0];
13 | p[0] = p[1];
14 | p[1] = tmp;
15 | p += 2;
16 | leng--;
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/codecnv/tcswap32.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "textcnv.h"
3 |
4 |
5 | void textcnv_swapendian32(void *buf, UINT leng) {
6 |
7 | UINT8 *p;
8 | UINT8 tmp0;
9 | UINT8 tmp1;
10 |
11 | p = (UINT8 *)buf;
12 | while(leng) {
13 | tmp0 = p[0];
14 | tmp1 = p[1];
15 | p[0] = p[3];
16 | p[1] = p[2];
17 | p[2] = tmp1;
18 | p[3] = tmp0;
19 | p += 4;
20 | leng--;
21 | }
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/codecnv/textcnv.h:
--------------------------------------------------------------------------------
1 |
2 | // テキストファイルの変換ルール
3 |
4 | enum {
5 | TEXTCNV_DEFAULT = 0,
6 | TEXTCNV_SJIS = 1,
7 | TEXTCNV_EUC = 2,
8 | TEXTCNV_UTF8 = 3,
9 | TEXTCNV_UCS2 = 4
10 | };
11 |
12 | enum {
13 | TEXTCNV_READ = 0x01,
14 | TEXTCNV_WRITE = 0x02
15 | };
16 |
17 | typedef UINT (*TCTOOEM)(OEMCHAR *dst, UINT dcnt, const void *src, UINT scnt);
18 | typedef UINT (*TCFROMOEM)(void *dst, UINT dcnt, const OEMCHAR *src, UINT scnt);
19 |
20 | typedef struct {
21 | UINT8 caps;
22 | UINT8 xendian;
23 | UINT8 width;
24 | UINT8 hdrsize;
25 | TCTOOEM tooem;
26 | TCFROMOEM fromoem;
27 | } TCINF;
28 |
29 |
30 | #ifdef __cplusplus
31 | extern "C" {
32 | #endif
33 |
34 | UINT textcnv_getinfo(TCINF *inf, const UINT8 *hdr, UINT hdrsize);
35 | void textcnv_swapendian16(void *buf, UINT leng);
36 | void textcnv_swapendian32(void *buf, UINT leng);
37 |
38 | #ifdef __cplusplus
39 | }
40 | #endif
41 |
42 |
--------------------------------------------------------------------------------
/common/arcunzip.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | ARCH arcunzip_open(const OEMCHAR *path);
7 |
8 | #ifdef __cplusplus
9 | }
10 | #endif
11 |
12 |
--------------------------------------------------------------------------------
/common/lstarray.h:
--------------------------------------------------------------------------------
1 | #ifndef LSTARRAY_H
2 | #define LSTARRAY_H
3 |
4 | typedef struct _la {
5 | UINT maxitems;
6 | size_t listsize;
7 | UINT items;
8 | struct _la *laNext;
9 | } _LISTARRAY, *LISTARRAY;
10 |
11 |
12 | #ifdef __cplusplus
13 | extern "C" {
14 | #endif
15 |
16 | LISTARRAY listarray_new(size_t listsize, UINT maxitems);
17 | void listarray_clr(LISTARRAY laHandle);
18 | void listarray_destroy(LISTARRAY laHandle);
19 |
20 | UINT listarray_getitems(LISTARRAY laHandle);
21 | void *listarray_append(LISTARRAY laHandle, const void *vpItem);
22 | void *listarray_getitem(LISTARRAY laHandle, UINT num);
23 | UINT listarray_getpos(LISTARRAY laHandle, void *vpItem);
24 | void *listarray_enum(LISTARRAY laHandle,
25 | BOOL (*cbProc)(void *vpItem, void *vpArg), void *vpArg);
26 |
27 | #ifdef __cplusplus
28 | }
29 | #endif
30 |
31 | #endif /* LSTARRAY_H */
--------------------------------------------------------------------------------
/common/mimpidef.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | MIMPI_LA = 0,
4 | MIMPI_PCM,
5 | MIMPI_GS,
6 | MIMPI_RHYTHM
7 | };
8 |
9 | typedef struct {
10 | UINT8 ch[16];
11 | UINT8 map[3][128];
12 | UINT8 bank[3][128];
13 | } MIMPIDEF;
14 |
15 |
16 | #ifdef __cplusplus
17 | extern "C" {
18 | #endif
19 |
20 | BRESULT mimpidef_load(MIMPIDEF *def, const OEMCHAR *filename);
21 |
22 | #ifdef __cplusplus
23 | }
24 | #endif
25 |
26 |
--------------------------------------------------------------------------------
/common/parts.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef PARTSCALL
3 | #define PARTSCALL
4 | #endif
5 |
6 | #ifdef __cplusplus
7 | extern "C" {
8 | #endif
9 |
10 | void PARTSCALL rand_setseed(SINT32 seed);
11 | SINT32 PARTSCALL rand_get(void);
12 | UINT8 PARTSCALL AdjustAfterMultiply(UINT8 value);
13 | UINT8 PARTSCALL AdjustBeforeDivision(UINT8 value);
14 | UINT PARTSCALL sjis2jis(UINT sjis);
15 | UINT PARTSCALL jis2sjis(UINT jis);
16 | void PARTSCALL satuation_s16(SINT16 *dst, const SINT32 *src, UINT size);
17 | void PARTSCALL satuation_s16x(SINT16 *dst, const SINT32 *src, UINT size);
18 |
19 | #ifdef __cplusplus
20 | }
21 | #endif
22 |
23 |
--------------------------------------------------------------------------------
/common/rect.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | int x;
4 | int y;
5 | } POINT_T;
6 |
7 | typedef struct {
8 | int left;
9 | int top;
10 | int right;
11 | int bottom;
12 | } RECT_T;
13 |
14 | typedef struct {
15 | int left;
16 | int top;
17 | int width;
18 | int height;
19 | } SCRN_T;
20 |
21 | typedef union {
22 | POINT_T p;
23 | RECT_T r;
24 | SCRN_T s;
25 | } RECT_U;
26 |
27 | typedef struct {
28 | int type;
29 | RECT_T r;
30 | } UNIRECT;
31 |
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif
36 |
37 | BOOL rect_in(const RECT_T *rect, int x, int y);
38 | int rect_num(const RECT_T *rect, int cnt, int x, int y);
39 | BOOL rect_isoverlap(const RECT_T *r1, const RECT_T *r2);
40 | void rect_enumout(const RECT_T *tag, const RECT_T *base,
41 | void *arg, void (*outcb)(void *arg, const RECT_T *rect));
42 | void rect_add(RECT_T *dst, const RECT_T *src);
43 |
44 | void unionrect_rst(UNIRECT *unirct);
45 | void unionrect_add(UNIRECT *unirct, const RECT_T *rct);
46 | const RECT_T *unionrect_get(const UNIRECT *unirct);
47 |
48 | #ifdef __cplusplus
49 | }
50 | #endif
51 |
52 |
--------------------------------------------------------------------------------
/common/resize.h:
--------------------------------------------------------------------------------
1 |
2 | #define RESIZE_AREAAVG
3 | #define RESIZE_FASTCOPY
4 |
5 | enum {
6 | RSZFN_8BPP = 0,
7 | RSZFN_16BPP,
8 | RSZFN_24BPP,
9 | RSZFN_16BY24,
10 | RSZFN_24BY16,
11 | RSZFNMAX
12 | };
13 |
14 | struct _rszhdl;
15 | typedef struct _rszhdl _RSZHDL;
16 | typedef struct _rszhdl *RSZHDL;
17 |
18 | typedef void (*RSZFN)(RSZHDL hdl, UINT type, UINT8 *dst, int dalign,
19 | const UINT8 *src, int salign);
20 |
21 | struct _rszhdl {
22 | RSZFN func;
23 | int width;
24 | int height;
25 | };
26 |
27 |
28 | #ifdef __cplusplus
29 | extern "C" {
30 | #endif
31 |
32 | UINT resize_gettype(int dbpp, int sbpp);
33 | RSZHDL resize(int xdst, int ydst, int xsrc, int ysrc);
34 |
35 | #ifdef __cplusplus
36 | }
37 | #endif
38 |
39 |
--------------------------------------------------------------------------------
/common/textfile.h:
--------------------------------------------------------------------------------
1 |
2 | typedef void *TEXTFILEH;
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | TEXTFILEH textfile_open(const OEMCHAR *filename, UINT buffersize);
9 | TEXTFILEH textfile_create(const OEMCHAR *filename, UINT buffersize);
10 | BRESULT textfile_read(TEXTFILEH fh, OEMCHAR *buffer, UINT size);
11 | BRESULT textfile_write(TEXTFILEH fh, const OEMCHAR *buffer);
12 | void textfile_close(TEXTFILEH fh);
13 |
14 | #ifdef __cplusplus
15 | }
16 | #endif
17 |
18 |
--------------------------------------------------------------------------------
/common/wavefile.h:
--------------------------------------------------------------------------------
1 |
2 | // あとで GETSNDに乗り換えるかも…
3 |
4 | #if defined(BYTESEX_BIG)
5 | #define WAVE_SIG(a, b, c, d) \
6 | (UINT32)((d) + ((c) << 8) + ((b) << 16) + ((a) << 24))
7 | #else
8 | #define WAVE_SIG(a, b, c, d) \
9 | (UINT32)((a) + ((b) << 8) + ((c) << 16) + ((d) << 24))
10 | #endif
11 |
12 | typedef struct {
13 | UINT32 sig;
14 | UINT8 size[4];
15 | UINT32 fmt;
16 | } RIFF_HEADER;
17 |
18 | typedef struct {
19 | UINT sig;
20 | UINT8 size[4];
21 | } WAVE_HEADER;
22 |
23 | typedef struct {
24 | UINT8 format[2];
25 | UINT8 channel[2];
26 | UINT8 rate[4];
27 | UINT8 rps[4];
28 | UINT8 block[2];
29 | UINT8 bit[2];
30 | } WAVE_INFOS;
31 |
32 |
33 | // ---- write
34 |
35 | typedef struct {
36 | INTPTR fh;
37 | UINT rate;
38 | UINT bits;
39 | UINT ch;
40 | UINT size;
41 |
42 | UINT8 *ptr;
43 | UINT remain;
44 | UINT8 buf[4096];
45 | } _WAVEWR, *WAVEWR;
46 |
47 |
48 | #ifdef __cplusplus
49 | extern "C" {
50 | #endif
51 |
52 | WAVEWR wavewr_open(const OEMCHAR *filename, UINT rate, UINT bits, UINT ch);
53 | UINT wavewr_write(WAVEWR hdl, const void *buf, UINT size);
54 | void wavewr_close(WAVEWR hdl);
55 |
56 | #ifdef __cplusplus
57 | }
58 | #endif
59 |
60 |
--------------------------------------------------------------------------------
/debugsub.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | const OEMCHAR *debugsub_flags(UINT16 flag);
7 | const OEMCHAR *debugsub_regs(void);
8 | void debugsub_status(void);
9 | void debugsub_memorydump(void);
10 | void debugsub_memorydumpall(void);
11 |
12 | #ifdef __cplusplus
13 | }
14 | #endif
15 |
16 |
--------------------------------------------------------------------------------
/embed/menu/dlgabout.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(SIZE_QVGA)
3 | enum {
4 | DLGABOUT_WIDTH = 232,
5 | DLGABOUT_HEIGHT = 40
6 | };
7 | #else
8 | enum {
9 | DLGABOUT_WIDTH = 342,
10 | DLGABOUT_HEIGHT = 58
11 | };
12 | #endif
13 |
14 |
15 | #ifdef __cplusplus
16 | extern "C" {
17 | #endif
18 |
19 | int dlgabout_cmd(int msg, MENUID id, long param);
20 |
21 | #ifdef __cplusplus
22 | }
23 | #endif
24 |
25 |
--------------------------------------------------------------------------------
/embed/menu/dlgcfg.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(SIZE_QVGA)
3 | enum {
4 | DLGCFG_WIDTH = 254,
5 | DLGCFG_HEIGHT = 180
6 | };
7 | #else
8 | enum {
9 | DLGCFG_WIDTH = 303,
10 | DLGCFG_HEIGHT = 214
11 | };
12 | #endif
13 |
14 |
15 | #ifdef __cplusplus
16 | extern "C" {
17 | #endif
18 |
19 | int dlgcfg_cmd(int msg, MENUID id, long param);
20 |
21 | #ifdef __cplusplus
22 | }
23 | #endif
24 |
25 |
--------------------------------------------------------------------------------
/embed/menu/dlgscr.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(SIZE_QVGA)
3 | enum {
4 | DLGSCR_WIDTH = 280,
5 | DLGSCR_HEIGHT = 166
6 | };
7 | #else
8 | enum {
9 | DLGSCR_WIDTH = 393,
10 | DLGSCR_HEIGHT = 235
11 | };
12 | #endif
13 |
14 | #ifdef __cplusplus
15 | extern "C" {
16 | #endif
17 |
18 | int dlgscr_cmd(int msg, MENUID id, long param);
19 |
20 | #ifdef __cplusplus
21 | }
22 | #endif
23 |
24 |
--------------------------------------------------------------------------------
/embed/menu/filesel.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void filesel_fdd(REG8 drv);
7 | void filesel_hdd(REG8 drv);
8 |
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/embed/menu/menustr.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | extern const OEMCHAR mstr_cfg[];
7 | extern const OEMCHAR mstr_scropt[];
8 | extern const OEMCHAR mstr_about[];
9 |
10 | extern const MENURES np2icon;
11 |
12 | #ifdef __cplusplus
13 | }
14 | #endif
15 |
16 |
--------------------------------------------------------------------------------
/embed/menubase/menuicon.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | MICON_NULL = 0,
4 | MICON_STOP,
5 | MICON_QUESTION,
6 | MICON_EXCLAME,
7 | MICON_INFO,
8 | MICON_FOLDER,
9 | MICON_FOLDERPARENT,
10 | MICON_FILE,
11 | MICON_USER
12 | };
13 |
14 | #ifdef __cplusplus
15 | extern "C" {
16 | #endif
17 |
18 | void menuicon_initialize(void);
19 | void menuicon_deinitialize(void);
20 | void menuicon_regist(UINT16 id, const MENURES *res);
21 | VRAMHDL menuicon_lock(UINT16 id, int width, int height, int bpp);
22 | void menuicon_unlock(VRAMHDL vram);
23 |
24 | #ifdef __cplusplus
25 | }
26 | #endif
27 |
28 |
--------------------------------------------------------------------------------
/embed/menubase/menumbox.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | MBOX_OK = 0x0000,
4 | MBOX_OKCANCEL = 0x0001,
5 | MBOX_ABORT = 0x0002,
6 | MBOX_YESNOCAN = 0x0003,
7 | MBOX_YESNO = 0x0004,
8 | MBOX_RETRY = 0x0005,
9 | MBOX_ICONSTOP = 0x0010,
10 | MBOX_ICONQUESTION = 0x0020,
11 | MBOX_ICONEXCLAME = 0x0030,
12 | MBOX_ICONINFO = 0x0040
13 | };
14 |
15 | #ifdef __cplusplus
16 | extern "C" {
17 | #endif
18 |
19 | int menumbox(const OEMCHAR *string, const OEMCHAR *title, UINT type);
20 |
21 | #ifdef __cplusplus
22 | }
23 | #endif
24 |
25 |
--------------------------------------------------------------------------------
/embed/menubase/menures.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | extern const OEMCHAR mstr_fontcheck[];
7 | extern const OEMCHAR mstr_ok[];
8 | extern const OEMCHAR mstr_cancel[];
9 | extern const OEMCHAR mstr_abort[];
10 | extern const OEMCHAR mstr_retry[];
11 | extern const OEMCHAR mstr_ignore[];
12 | extern const OEMCHAR mstr_yes[];
13 | extern const OEMCHAR mstr_no[];
14 |
15 | extern const MENURES2 menures_minimize;
16 | extern const MENURES2 menures_close;
17 |
18 | extern const MENURES2 menures_sys[2];
19 |
20 | extern const MENURES2 menures_radio[3];
21 | extern const MENURES2 menures_check;
22 | extern const MENURES2 menures_scrbtn[2];
23 |
24 | extern const UINT8 menures_slddat[];
25 | extern const UINT16 menures_sldpos[3][12];
26 |
27 | #ifdef __cplusplus
28 | }
29 | #endif
30 |
31 |
--------------------------------------------------------------------------------
/embed/readme.txt:
--------------------------------------------------------------------------------
1 |
2 | あの妖しい組み込み専用関数群が復活(?)
3 |
4 | 組み込みマシン以外はリンク不要です。
5 |
6 |
7 | っていうか、ドロップダウンリストほすぃ…
8 |
9 |
--------------------------------------------------------------------------------
/fdd/diskdrv.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | // extern int diskdrv_delay[4];
7 | // extern OEMCHAR diskdrv_fname[4][MAX_PATH];
8 |
9 | void diskdrv_setsxsi(REG8 drv, const OEMCHAR *fname);
10 | OEMCHAR *diskdrv_getsxsi(REG8 drv);
11 | void diskdrv_hddbind(void);
12 |
13 | void diskdrv_readyfddex(REG8 drv, const OEMCHAR *fname,
14 | UINT ftype, int readonly);
15 | void diskdrv_setfddex(REG8 drv, const OEMCHAR *fname,
16 | UINT ftype, int readonly);
17 | void diskdrv_callback(void);
18 |
19 | #ifdef __cplusplus
20 | }
21 | #endif
22 |
23 |
24 | // ---- macro
25 |
26 | #define diskdrv_readyfdd(d, f, r) diskdrv_readyfddex(d, f, FTYPE_NONE, r)
27 | #define diskdrv_setfdd(d, f, r) diskdrv_setfddex(d, f, FTYPE_NONE, r)
28 |
29 |
30 | // ---- old interface
31 |
32 | #define diskdrv_sethdd(d, f) diskdrv_setsxsi(d, f)
33 |
34 |
--------------------------------------------------------------------------------
/fdd/fdd_d88.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | BRESULT fddd88_set(FDDFILE fdd, const OEMCHAR *fname, int ro);
7 | BRESULT fddd88_eject(FDDFILE fdd);
8 |
9 | BRESULT fdd_diskaccess_d88(void);
10 | BRESULT fdd_seek_d88(void);
11 | BRESULT fdd_seeksector_d88(void);
12 | BRESULT fdd_read_d88(void);
13 | BRESULT fdd_write_d88(void);
14 | BRESULT fdd_diagread_d88(void);
15 | BRESULT fdd_readid_d88(void);
16 | BRESULT fdd_writeid_d88(void);
17 |
18 | BRESULT fdd_formatinit_d88(void);
19 | BRESULT fdd_formating_d88(const UINT8 *ID);
20 | BOOL fdd_isformating_d88(void);
21 |
22 | #ifdef __cplusplus
23 | }
24 | #endif
25 |
26 |
--------------------------------------------------------------------------------
/fdd/fdd_mtr.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | int busy;
4 | UINT8 head[4];
5 | UINT nextevent;
6 | UINT8 curevent;
7 | } _FDDMTR, *FDDMTR;
8 |
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | extern _FDDMTR fddmtr;
15 |
16 | void fdbiosout(NEVENTITEM item);
17 |
18 | void fddmtr_initialize(void);
19 | void fddmtr_callback(UINT time);
20 | void fddmtr_seek(REG8 drv, REG8 c, UINT size);
21 | void fddmtr_reset(void);
22 |
23 |
24 | #if defined(SUPPORT_SWSEEKSND)
25 | void fddmtrsnd_initialize(UINT rate);
26 | void fddmtrsnd_bind(void);
27 | void fddmtrsnd_deinitialize(void);
28 | #else
29 | #define fddmtrsnd_initialize(r)
30 | #define fddmtrsnd_bind()
31 | #define fddmtrsnd_deinitialize()
32 | #endif
33 |
34 | #ifdef __cplusplus
35 | }
36 | #endif
37 |
38 |
--------------------------------------------------------------------------------
/fdd/fdd_xdf.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | BRESULT fddxdf_set(FDDFILE fdd, const OEMCHAR *fname, int ro);
7 | BRESULT fddxdf_setfdi(FDDFILE fdd, const OEMCHAR *fname, int ro);
8 | BRESULT fddxdf_eject(FDDFILE fdd);
9 |
10 | BRESULT fddxdf_diskaccess(FDDFILE fdd);
11 | BRESULT fddxdf_seek(FDDFILE fdd);
12 | BRESULT fddxdf_seeksector(FDDFILE fdd);
13 | BRESULT fddxdf_read(FDDFILE fdd);
14 | BRESULT fddxdf_write(FDDFILE fdd);
15 | BRESULT fddxdf_readid(FDDFILE fdd);
16 |
17 | #ifdef __cplusplus
18 | }
19 | #endif
20 |
21 |
--------------------------------------------------------------------------------
/fdd/hddboot.res:
--------------------------------------------------------------------------------
1 |
2 | static const UINT8 hdddiskboot[] = {
3 | 0xeb,0x0a,0x90,0x90,0x49,0x50,0x4c,0x31,0x00,0x00,0x00,0x1e,
4 | 0xb8,0x04,0x0a,0xcd,0x18,0xb4,0x16,0xba,0x20,0xe1,0xcd,0x18,
5 | 0xfa,0xfc,0xb8,0x00,0xa0,0x8e,0xc0,0xbe,0x3c,0x00,0x31,0xff,
6 | 0xe8,0x09,0x00,0xbf,0xa0,0x00,0xe8,0x03,0x00,0xf4,0xeb,0xfd,
7 | 0x2e,0xad,0x85,0xc0,0x74,0x05,0xab,0x47,0x47,0xeb,0xf5,0xc3,
8 | 0x04,0x33,0x04,0x4e,0x05,0x4f,0x01,0x3c,0x05,0x49,0x05,0x47,
9 | 0x05,0x23,0x05,0x39,0x05,0x2f,0x05,0x24,0x05,0x61,0x01,0x3c,
10 | 0x05,0x38,0x04,0x4f,0x05,0x55,0x05,0x29,0x01,0x3c,0x05,0x5e,
11 | 0x05,0x43,0x05,0x48,0x04,0x35,0x04,0x6c,0x04,0x46,0x04,0x24,
12 | 0x04,0x5e,0x04,0x3b,0x04,0x73,0x01,0x25,0x00,0x00,0x05,0x47,
13 | 0x05,0x23,0x05,0x39,0x05,0x2f,0x05,0x24,0x05,0x61,0x01,0x3c,
14 | 0x05,0x38,0x04,0x72,0x21,0x5e,0x26,0x7e,0x18,0x65,0x01,0x24,
15 | 0x05,0x6a,0x05,0x3b,0x05,0x43,0x05,0x48,0x04,0x37,0x04,0x46,
16 | 0x12,0x3c,0x04,0x35,0x04,0x24,0x01,0x25,0x00,0x00,
17 | };
18 |
--------------------------------------------------------------------------------
/fdd/newdisk.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void newdisk_fdd(const OEMCHAR *fname, REG8 type, const OEMCHAR *label);
7 |
8 | void newdisk_thd(const OEMCHAR *fname, UINT hddsize);
9 | void newdisk_nhd(const OEMCHAR *fname, UINT hddsize);
10 | void newdisk_hdi(const OEMCHAR *fname, UINT hddtype);
11 | void newdisk_vhd(const OEMCHAR *fname, UINT hddsize);
12 |
13 | #ifdef __cplusplus
14 | }
15 | #endif
16 |
17 |
--------------------------------------------------------------------------------
/fdd/sxsicd.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | enum {
7 | SXSIMEDIA_DATA = 0x10,
8 | SXSIMEDIA_AUDIO = 0x20
9 | };
10 |
11 | typedef struct {
12 | UINT8 type;
13 | UINT8 track;
14 | UINT32 pos;
15 | } _CDTRK, *CDTRK;
16 |
17 | BRESULT sxsicd_open(SXSIDEV sxsi, const OEMCHAR *fname);
18 |
19 | CDTRK sxsicd_gettrk(SXSIDEV sxsi, UINT *tracks);
20 | BRESULT sxsicd_readraw(SXSIDEV sxsi, long pos, void *buf);
21 |
22 | #ifdef __cplusplus
23 | }
24 | #endif
25 |
26 |
--------------------------------------------------------------------------------
/font/font.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file font.h
3 | * @brief CGROM and font loader
4 | *
5 | * @author $Author: yui $
6 | * @date $Date: 2011/02/23 10:11:44 $
7 | */
8 |
9 | #define FONTMEMORYBIND // 520KBくらいメモリ削除(ぉぃ
10 |
11 | #ifdef __cplusplus
12 | extern "C" {
13 | #endif
14 |
15 | #ifdef FONTMEMORYBIND
16 | #define fontrom (mem + FONT_ADRS)
17 | #else
18 | extern UINT8 __font[0x84000];
19 | #define fontrom (__font)
20 | #endif
21 |
22 | void font_initialize(void);
23 | void font_setchargraph(BOOL epson);
24 | UINT8 font_load(const OEMCHAR *filename, BOOL force);
25 |
26 | #ifdef __cplusplus
27 | }
28 | #endif
29 |
30 |
--------------------------------------------------------------------------------
/font/fontmake.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void makepc98bmp(const OEMCHAR *filename);
7 |
8 | #ifdef __cplusplus
9 | }
10 | #endif
11 |
12 |
--------------------------------------------------------------------------------
/font/readme.txt:
--------------------------------------------------------------------------------
1 |
2 | 本フォルダのソースファイルについては特に説明しません。
3 |
4 | ノーチェックの部分もあります。
5 |
6 |
7 | あくまでオリジナルフォントや個人的なフォントの模様替えの為であって
8 | 他のエミュレータまでに御迷惑をお掛けしたくありません。
9 |
10 | また、違法行為を助長する為の物でもありません。
11 |
12 |
13 |
14 | font[]
15 | ANK 8x 8 - 0x82000 + (ank << 3)
16 | ANK 8x16 - 0x80000 + (ank << 4)
17 | KNJ 8x16 - 0x00000 + ((jish - 0x20) << 4) + (jisl << 12) (left)
18 | 0x00800 + ((jish - 0x20) << 4) + (jisl << 12) (right)
19 |
20 |
--------------------------------------------------------------------------------
/generic/cmjasts.h:
--------------------------------------------------------------------------------
1 |
2 | // ---- com manager jast sound
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | COMMNG cmjasts_create(void);
9 |
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 |
14 |
--------------------------------------------------------------------------------
/generic/cmver.h:
--------------------------------------------------------------------------------
1 |
2 | // vermouthのみ使用のCOMMNG-MIDI
3 | // あまりに一緒すぎるんで 関数名変えてこっちへ
4 |
5 |
6 | // ---- com manager midi for vermouth
7 |
8 | #define COMSIG_MIDI 0x4944494d
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | void cmvermouth_initialize(void);
15 | COMMNG cmvermouth_create(void);
16 | #if defined(VERMOUTH_LIB)
17 | void cmvermouth_load(UINT rate);
18 | void cmvermouth_unload(void);
19 | #endif
20 |
21 | #ifdef __cplusplus
22 | }
23 | #endif
24 |
25 |
--------------------------------------------------------------------------------
/generic/dipswbmp.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C"{
4 | #endif
5 |
6 |
7 | // それぞれ 4bit BMPが返る (メモリ解放を行なうこと)
8 |
9 | UINT8 *dipswbmp_get9861(const UINT8 *s, const UINT8 *j);
10 |
11 | UINT8 *dipswbmp_getsnd26(UINT8 cfg);
12 | UINT8 *dipswbmp_getsnd86(UINT8 cfg);
13 | UINT8 *dipswbmp_getsndspb(UINT8 cfg, UINT8 vrc);
14 | UINT8 *dipswbmp_getmpu(UINT8 cfg);
15 |
16 | #ifdef __cplusplus
17 | }
18 | #endif
19 |
20 |
--------------------------------------------------------------------------------
/generic/hostdrvs.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | char fcbname[11];
4 | UINT8 exist;
5 | UINT caps;
6 | UINT32 size;
7 | UINT32 attr;
8 | DOSDATE date;
9 | DOSTIME time;
10 | } HDRVDIR;
11 |
12 | typedef struct {
13 | HDRVDIR di;
14 | OEMCHAR realname[MAX_PATH];
15 | } _HDRVLST, *HDRVLST;
16 |
17 | typedef struct {
18 | HDRVDIR di;
19 | OEMCHAR path[MAX_PATH];
20 | } HDRVPATH;
21 |
22 |
23 | // 一覧取得
24 | LISTARRAY hostdrvs_getpathlist(const OEMCHAR *realpath);
25 |
26 | // ホスト側のフォルダを得る
27 | BRESULT hostdrvs_getrealdir(OEMCHAR *path, int size, char *fcb, char *dospath);
28 |
29 | // ホスト側のファイル名を得る
30 | BRESULT hostdrvs_getrealpath(HDRVPATH *hdp, char *dospath);
31 |
32 | // ホスト側のファイル名を作る
33 | BRESULT hostdrvs_newrealpath(HDRVPATH *hdp, char *dospath);
34 |
35 | // ファイルハンドルリスト
36 | void hostdrvs_fhdlallclose(LISTARRAY fhdl);
37 | HDRVFILE hostdrvs_fhdlsea(LISTARRAY fhdl);
38 |
39 |
--------------------------------------------------------------------------------
/generic/keydisp.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/generic/keydisp.res
--------------------------------------------------------------------------------
/generic/memdbg32.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(CPUCORE_IA32) && defined(SUPPORT_MEMDBG32)
3 |
4 | #include "cmndraw.h"
5 |
6 | enum {
7 | MEMDBG32_BLOCKW = 3,
8 | MEMDBG32_BLOCKH = 6,
9 | };
10 |
11 | enum {
12 | MEMDBG32_PALBG = 0,
13 | MEMDBG32_PALBDR,
14 | MEMDBG32_PALREAL,
15 | MEMDBG32_PALPM,
16 | MEMDBG32_PALPAGE0,
17 | MEMDBG32_PALPAGE1,
18 | MEMDBG32_PALTXT,
19 |
20 | MEMDBG32_PALS
21 | };
22 |
23 | enum {
24 | MEMDBG32_FLAGDRAW = 0x01,
25 | MEMDBG32_FLAGREDRAW = 0x02
26 | };
27 |
28 |
29 | #ifdef __cplusplus
30 | extern "C" {
31 | #endif
32 |
33 | void memdbg32_initialize(void);
34 | void memdbg32_getsize(int *width, int *height);
35 | REG8 memdbg32_process(void);
36 | BOOL memdbg32_paint(CMNVRAM *vram, CMNPALCNV cnv, BOOL redraw);
37 |
38 | #ifdef __cplusplus
39 | }
40 | #endif
41 |
42 | #endif
43 |
44 |
--------------------------------------------------------------------------------
/generic/np2info.h:
--------------------------------------------------------------------------------
1 |
2 | struct _np2infoex;
3 | typedef struct _np2infoex NP2INFOEX;
4 |
5 | struct _np2infoex {
6 | OEMCHAR cr[4];
7 | BOOL (*ext)(OEMCHAR *dst, const OEMCHAR *key, int maxlen,
8 | const NP2INFOEX *ex);
9 | };
10 |
11 |
12 | #ifdef __cplusplus
13 | extern "C" {
14 | #endif
15 |
16 | void np2info(OEMCHAR *dst, const OEMCHAR *src, int maxlen,
17 | const NP2INFOEX *ex);
18 |
19 | #ifdef __cplusplus
20 | }
21 | #endif
22 |
23 |
--------------------------------------------------------------------------------
/generic/readme.txt:
--------------------------------------------------------------------------------
1 |
2 | 一般的な奴。
3 |
4 | keydispとか
5 | hostdrvとかもここ?
6 | ジャストサウンド?(汗;
7 |
8 |
--------------------------------------------------------------------------------
/generic/softkbd.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(SUPPORT_SOFTKBD)
3 |
4 | #include "cmndraw.h"
5 |
6 | enum {
7 | LEDFLAG_NUM = 0x01,
8 | LEDFLAG_CAPS = 0x04,
9 | LEDFLAG_KANA = 0x08
10 | };
11 |
12 | enum {
13 | SOFTKEY_FLAGDRAW = 0x01,
14 | SOFTKEY_FLAGREDRAW = 0x02
15 | };
16 |
17 |
18 | #ifdef __cplusplus
19 | extern "C" {
20 | #endif
21 |
22 | void softkbd_initialize(void);
23 | void softkbd_deinitialize(void);
24 | BRESULT softkbd_getsize(int *width, int *height);
25 | REG8 softkbd_process(void);
26 | BOOL softkbd_paint(CMNVRAM *vram, CMNPALCNV cnv, BOOL redraw);
27 | BOOL softkbd_down(int x, int y);
28 | void softkbd_up(void);
29 | void softkbd_led(REG8 led);
30 |
31 | #ifdef __cplusplus
32 | }
33 | #endif
34 |
35 | #endif
36 |
37 |
--------------------------------------------------------------------------------
/generic/softkbd.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/generic/softkbd.res
--------------------------------------------------------------------------------
/generic/softkbd3.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/generic/softkbd3.res
--------------------------------------------------------------------------------
/generic/unasm.h:
--------------------------------------------------------------------------------
1 | enum OPTYPE;
2 |
3 | enum {
4 | MI_WRITE = 0,
5 | MI_READ = 1
6 | };
7 |
8 | typedef struct {
9 | UINT8 type;
10 | UINT16 seg;
11 | UINT16 off;
12 | } UNASM_MEMINFO;
13 |
14 | typedef struct _UNASM_t {
15 | const char *mnemonic;
16 | char operand[44];
17 | UNASM_MEMINFO meminf[2];
18 | } _UNASM, *UNASM;
19 |
20 |
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | UINT unasm(UNASM r, const UINT8 *ptr, UINT leng, BOOL d, UINT32 addr);
26 |
27 | #ifdef __cplusplus
28 | }
29 | #endif
30 |
31 |
--------------------------------------------------------------------------------
/i286c/v30patch.h:
--------------------------------------------------------------------------------
1 |
2 | void v30cinit(void);
3 |
4 |
--------------------------------------------------------------------------------
/i286c/x64/cpucore.inc:
--------------------------------------------------------------------------------
1 |
2 | USE_HIMEM equ 0x110000
3 |
4 | VRAM_STEP equ 0x100000
5 | VRAM_B equ 0x0a8000
6 | VRAM_R equ 0x0b0000
7 | VRAM_G equ 0x0b8000
8 | VRAM_E equ 0x0e0000
9 |
10 | VRAM0_B equ VRAM_B
11 | VRAM0_R equ VRAM_R
12 | VRAM0_G equ VRAM_G
13 | VRAM0_E equ VRAM_E
14 | VRAM1_B equ VRAM_B + VRAM_STEP
15 | VRAM1_R equ VRAM_R + VRAM_STEP
16 | VRAM1_G equ VRAM_G + VRAM_STEP
17 | VRAM1_E equ VRAM_E + VRAM_STEP
18 |
19 | FONT_ADRS equ 0x110000
20 | ITF_ADRS equ 0x1f8000
21 |
22 | %macro VRAMPOS 1
23 | and %1, VRAM_STEP | 7fffh
24 | %endmacro
25 |
26 |
--------------------------------------------------------------------------------
/i286c/x86/cpucore.inc:
--------------------------------------------------------------------------------
1 |
2 | USE_HIMEM equ 0x110000
3 |
4 | VRAM_STEP equ 0x100000
5 | VRAM_B equ 0x0a8000
6 | VRAM_R equ 0x0b0000
7 | VRAM_G equ 0x0b8000
8 | VRAM_E equ 0x0e0000
9 |
10 | VRAM0_B equ VRAM_B
11 | VRAM0_R equ VRAM_R
12 | VRAM0_G equ VRAM_G
13 | VRAM0_E equ VRAM_E
14 | VRAM1_B equ VRAM_B + VRAM_STEP
15 | VRAM1_R equ VRAM_R + VRAM_STEP
16 | VRAM1_G equ VRAM_G + VRAM_STEP
17 | VRAM1_E equ VRAM_E + VRAM_STEP
18 |
19 | FONT_ADRS equ 0x110000
20 | ITF_ADRS equ 0x1f8000
21 |
22 | %macro VRAMPOS 1
23 | and %1, VRAM_STEP | 7fffh
24 | %endmacro
25 |
26 |
27 | struc cpucore_t
28 | .reg resw 14
29 | .es_base resd 1
30 | .cs_base resd 1
31 | .ss_base resd 1
32 | .ds_base resd 1
33 | .ss_fix resd 1
34 | .ds_fix resd 1
35 | .adrsmask resd 1
36 | .prefix resw 1
37 | .trap resb 1
38 | .resetreq resb 1
39 | .ovflag resd 1
40 | .GDTR resb 6
41 | .MSW resw 1
42 | .IDTR resb 6
43 | .LDTR resw 1
44 | .LDTRC resb 6
45 | .TR resw 1
46 | .TRC resb 6
47 | resb 2
48 |
49 | .cpu_type resb 1
50 | .itfbank resb 1
51 | .ram_d0 resw 1
52 | .remainclock resd 1
53 | .baseclock resd 1
54 | .clock resd 1
55 |
56 | .ext resd 1
57 | .extsize resd 1
58 | .ems resd 4
59 | .repbak resd 1
60 | .inport resd 1
61 | endstruc
62 |
63 |
--------------------------------------------------------------------------------
/i286x/i286xadr.h:
--------------------------------------------------------------------------------
1 |
2 | extern I286TBL p_ea_dst[256];
3 | extern I286TBL p_lea[256];
4 | extern I286TBL p_get_ea[256];
5 |
6 |
--------------------------------------------------------------------------------
/i286x/i286xcts.h:
--------------------------------------------------------------------------------
1 |
2 | void _xcts(void);
3 |
4 |
--------------------------------------------------------------------------------
/i286x/i286xrep.h:
--------------------------------------------------------------------------------
1 | void rep_xinsb(void);
2 | void rep_xinsw(void);
3 | void rep_xoutsb(void);
4 | void rep_xoutsw(void);
5 | void rep_xmovsb(void);
6 | void rep_xmovsw(void);
7 | void rep_xlodsb(void);
8 | void rep_xlodsw(void);
9 | void rep_xstosb(void);
10 | void rep_xstosw(void);
11 |
12 | void repe_xcmpsb(void);
13 | void repne_xcmpsb(void);
14 | void repe_xcmpsw(void);
15 | void repne_xcmpsw(void);
16 |
17 | void repe_xscasb(void);
18 | void repne_xscasb(void);
19 | void repe_xscasw(void);
20 | void repne_xscasw(void);
21 |
--------------------------------------------------------------------------------
/i286x/i286xs.h:
--------------------------------------------------------------------------------
1 |
2 | extern const I286TBL op8xreg8_xtable[8];
3 | extern const I286TBL op8xext8_xtable[8];
4 | extern const I286TBL op8xreg16_xtable[8];
5 | extern const I286TBL op8xext16_xtable[8];
6 | extern const I286TBL op8xext16_atable[8];
7 |
8 | extern const I286TBL sftreg8_xtable[8];
9 | extern const I286TBL sftmem8_xtable[8];
10 | extern const I286TBL sftext8_xtable[8];
11 | extern const I286TBL sftreg16_xtable[8];
12 | extern const I286TBL sftmem16_xtable[8];
13 | extern const I286TBL sftext16_xtable[8];
14 |
15 | extern const I286TBL sftreg8cl_xtable[8];
16 | extern const I286TBL sftext8cl_xtable[8];
17 | extern const I286TBL sftreg16cl_xtable[8];
18 | extern const I286TBL sftext16cl_xtable[8];
19 |
20 | extern const I286TBL ope0xf6_xtable[8];
21 | extern const I286TBL ope0xf7_xtable[8];
22 | extern const I286TBL ope0xfe_xtable[2];
23 | extern const I286TBL ope0xff_xtable[8];
24 |
25 |
--------------------------------------------------------------------------------
/i286x/v30patch.h:
--------------------------------------------------------------------------------
1 |
2 | void v30xinit(void);
3 |
4 |
--------------------------------------------------------------------------------
/i386c/cpucore.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_I386C_CPUCORE_H__
2 | #define NP2_I386C_CPUCORE_H__
3 |
4 | #include "ia32/cpu.h"
5 |
6 | #define I286_MEMREADMAX CPU_MEMREADMAX
7 | #define I286_MEMWRITEMAX CPU_MEMWRITEMAX
8 |
9 | #endif /* !NP2_I386C_CPUCORE_H__ */
10 |
--------------------------------------------------------------------------------
/i386c/x64/cpucore.inc:
--------------------------------------------------------------------------------
1 |
2 | USE_HIMEM equ 0x110000
3 |
4 | VRAM_STEP equ 0x100000
5 | VRAM_B equ 0x0a8000
6 | VRAM_R equ 0x0b0000
7 | VRAM_G equ 0x0b8000
8 | VRAM_E equ 0x0e0000
9 |
10 | VRAM0_B equ VRAM_B
11 | VRAM0_R equ VRAM_R
12 | VRAM0_G equ VRAM_G
13 | VRAM0_E equ VRAM_E
14 | VRAM1_B equ VRAM_B + VRAM_STEP
15 | VRAM1_R equ VRAM_R + VRAM_STEP
16 | VRAM1_G equ VRAM_G + VRAM_STEP
17 | VRAM1_E equ VRAM_E + VRAM_STEP
18 |
19 | FONT_ADRS equ 0x110000
20 | ITF_ADRS equ 0x1f8000
21 |
22 | %macro VRAMPOS 1
23 | and %1, VRAM_STEP | 7fffh
24 | %endmacro
25 |
26 |
--------------------------------------------------------------------------------
/i386c/x86/cpucore.inc:
--------------------------------------------------------------------------------
1 |
2 | USE_HIMEM equ 0x110000
3 |
4 | VRAM_STEP equ 0x100000
5 | VRAM_B equ 0x0a8000
6 | VRAM_R equ 0x0b0000
7 | VRAM_G equ 0x0b8000
8 | VRAM_E equ 0x0e0000
9 |
10 | VRAM0_B equ VRAM_B
11 | VRAM0_R equ VRAM_R
12 | VRAM0_G equ VRAM_G
13 | VRAM0_E equ VRAM_E
14 | VRAM1_B equ VRAM_B + VRAM_STEP
15 | VRAM1_R equ VRAM_R + VRAM_STEP
16 | VRAM1_G equ VRAM_G + VRAM_STEP
17 | VRAM1_E equ VRAM_E + VRAM_STEP
18 |
19 | FONT_ADRS equ 0x110000
20 | ITF_ADRS equ 0x1f8000
21 |
22 | %macro VRAMPOS 1
23 | and %1, VRAM_STEP | 7fffh
24 | %endmacro
25 |
26 |
--------------------------------------------------------------------------------
/io/artic.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | SINT32 lastclk2;
4 | SINT32 counter;
5 | } _ARTIC, *ARTIC;
6 |
7 |
8 | #ifdef __cplusplus
9 | extern "C" {
10 | #endif
11 |
12 | void artic_callback(void);
13 |
14 | void artic_reset(const NP2CFG *pConfig);
15 | void artic_bind(void);
16 | REG16 IOINPCALL artic_r16(UINT port);
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 |
22 |
--------------------------------------------------------------------------------
/io/cgrom.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | UINT code;
4 | UINT lr;
5 | UINT line;
6 | } _CGROM, *CGROM;
7 |
8 | typedef struct {
9 | UINT32 low;
10 | UINT32 high;
11 | UINT8 writable;
12 | } _CGWINDOW, *CGWINDOW;
13 |
14 |
15 | #ifdef __cplusplus
16 | extern "C" {
17 | #endif
18 |
19 | void cgrom_reset(const NP2CFG *pConfig);
20 | void cgrom_bind(void);
21 |
22 | #ifdef __cplusplus
23 | }
24 | #endif
25 |
26 |
--------------------------------------------------------------------------------
/io/cpuio.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void cpuio_bind(void);
7 |
8 | #ifdef __cplusplus
9 | }
10 | #endif
11 |
12 |
--------------------------------------------------------------------------------
/io/crtc.h:
--------------------------------------------------------------------------------
1 |
2 | typedef union {
3 | struct {
4 | UINT8 pl;
5 | UINT8 bl;
6 | UINT8 cl;
7 | UINT8 ssl;
8 | UINT8 sur;
9 | UINT8 sdr;
10 | } reg;
11 | UINT8 b[6];
12 | } _CRTC, *CRTC;
13 |
14 | typedef union {
15 | UINT8 b[2];
16 | UINT16 w;
17 | } PAIR16;
18 |
19 | typedef struct {
20 | UINT32 counter;
21 | UINT16 mode;
22 | UINT8 modereg;
23 | UINT8 padding;
24 | PAIR16 tile[4];
25 | UINT32 gdcwithgrcg;
26 | UINT8 chip;
27 | } _GRCG, *GRCG;
28 |
29 |
30 | #ifdef __cplusplus
31 | extern "C" {
32 | #endif
33 |
34 | void crtc_reset(const NP2CFG *pConfig);
35 | void crtc_bind(void);
36 |
37 | void crtc_biosreset(void);
38 |
39 | #ifdef __cplusplus
40 | }
41 | #endif
42 |
43 |
--------------------------------------------------------------------------------
/io/dipsw.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void IOOUTCALL dipsw_w8(UINT port, REG8 value);
7 | REG8 IOINPCALL dipsw_r8(UINT port);
8 |
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/io/egc.h:
--------------------------------------------------------------------------------
1 |
2 | typedef union {
3 | UINT8 _b[2];
4 | UINT16 w;
5 | } EGCWORD;
6 |
7 | typedef union {
8 | UINT8 _b[4][2];
9 | UINT16 w[4];
10 | UINT32 d[2];
11 | } EGCQUAD;
12 |
13 | typedef struct {
14 | UINT16 access;
15 | UINT16 fgbg;
16 | UINT16 ope;
17 | UINT16 fg;
18 | EGCWORD mask;
19 | UINT16 bg;
20 | UINT16 sft;
21 | UINT16 leng;
22 | EGCQUAD lastvram;
23 | EGCQUAD patreg;
24 | EGCQUAD fgc;
25 | EGCQUAD bgc;
26 |
27 | int func;
28 | UINT remain;
29 | UINT stack;
30 | UINT8 *inptr;
31 | UINT8 *outptr;
32 | EGCWORD mask2;
33 | EGCWORD srcmask;
34 | UINT8 srcbit;
35 | UINT8 dstbit;
36 | UINT8 sft8bitl;
37 | UINT8 sft8bitr;
38 |
39 | UINT padding_b[4];
40 | UINT8 buf[4096/8 + 4*4];
41 | UINT padding_a[4];
42 | } _EGC, *EGC;
43 |
44 |
45 | #ifdef __cplusplus
46 | extern "C" {
47 | #endif
48 |
49 | void egc_reset(const NP2CFG *pConfig);
50 | void egc_bind(void);
51 | void IOOUTCALL egc_w16(UINT port, REG16 value);
52 |
53 | #ifdef __cplusplus
54 | }
55 | #endif
56 |
57 |
--------------------------------------------------------------------------------
/io/emsio.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | UINT8 maxmem;
4 | UINT8 target;
5 | UINT16 padding;
6 | UINT32 addr[4];
7 | } _EMSIO, *EMSIO;
8 |
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | void emsio_reset(const NP2CFG *pConfig);
15 | void emsio_bind(void);
16 |
17 | #ifdef __cplusplus
18 | }
19 | #endif
20 |
21 |
--------------------------------------------------------------------------------
/io/epsonio.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | UINT8 cpumode;
4 | UINT8 bankioen;
5 | } _EPSONIO;
6 |
7 |
8 | #ifdef __cplusplus
9 | extern "C" {
10 | #endif
11 |
12 | void epsonio_reset(const NP2CFG *pConfig);
13 | void epsonio_bind(void);
14 |
15 | #ifdef __cplusplus
16 | }
17 | #endif
18 |
19 |
--------------------------------------------------------------------------------
/io/fdd320.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "pccore.h"
3 | #include "iocore.h"
4 |
5 |
6 | // こっちで処理するか シリンダ倍移動で誤魔化すか悩ましいところ
7 |
8 | UINT8 fdd320_stat;
9 |
10 |
11 | static REG8 IOINPCALL fdd320_i51(UINT port) {
12 |
13 | (void)port;
14 | return(0x00);
15 | }
16 |
17 | static REG8 IOINPCALL fdd320_i55(UINT port) {
18 |
19 | fdd320_stat ^= 0xff;
20 | (void)port;
21 | return(fdd320_stat);
22 | }
23 |
24 |
25 | // ----
26 |
27 | static const IOINP fdd320i51[4] = {
28 | fdd320_i51, NULL, fdd320_i55, NULL};
29 |
30 | void fdd320_reset(const NP2CFG *pConfig) {
31 |
32 | fdd320_stat = 0xff;
33 | }
34 |
35 | void fdd320_bind(void) {
36 |
37 | iocore_attachcmninpex(0x0051, 0x00f9, fdd320i51, 4);
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/io/fdd320.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void fdd320_reset(const NP2CFG *pConfig);
7 | void fdd320_bind(void);
8 |
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/io/gdc_cmd.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | CMD_RESET = 0x00,
4 | CMD_SYNC_ON = 0x0f,
5 | CMD_SYNC_OFF = 0x0e,
6 | CMD_MASTER = 0x6f,
7 | CMD_SLAVE = 0x6e,
8 |
9 | CMD_START_ = 0x6b,
10 | CMD_START = 0x0d,
11 | CMD_STOP_ = 0x05,
12 | CMD_STOP = 0x0c,
13 |
14 | CMD_ZOOM = 0x06,
15 | CMD_SCROLL = 0x70,
16 | CMD_CSRW = 0x49,
17 | CMD_CSRFORM = 0x4b,
18 | CMD_PITCH = 0x47,
19 | CMD_LPEN = 0xc0,
20 | CMD_VECTW = 0x4c,
21 | CMD_VECTE = 0x6c,
22 | CMD_TEXTW = 0x78,
23 | CMD_TEXTE = 0x68,
24 | CMD_CSRR = 0xe0,
25 | CMD_MASK = 0x4a
26 | };
27 |
28 | enum {
29 | GDC_SYNC = 0, // 0
30 | GDC_ZOOM = (GDC_SYNC+8), // 8
31 | GDC_CSRFORM = (GDC_ZOOM+1), // 9
32 | GDC_SCROLL = (GDC_CSRFORM+3), // 12
33 | GDC_TEXTW = (GDC_SCROLL+8), // 20
34 | GDC_PITCH = (GDC_TEXTW+8), // 28
35 | GDC_LPEN = (GDC_PITCH+1), // 29
36 | GDC_VECTW = (GDC_LPEN+3), // 32
37 | GDC_CSRW = (GDC_VECTW+11), // 43
38 | GDC_MASK = (GDC_CSRW+3), // 46
39 | GDC_CSRR = (GDC_MASK+2), // 48
40 | GDC_WRITE = (GDC_CSRR+5), // 53
41 | GDC_CODE = (GDC_WRITE+1), // 54
42 | GDC_TERMDATA = (GDC_CODE+2)
43 | };
44 |
45 |
--------------------------------------------------------------------------------
/io/gdc_pset.h:
--------------------------------------------------------------------------------
1 |
2 | struct _gdcpset;
3 | typedef struct _gdcpset _GDCPSET;
4 | typedef struct _gdcpset *GDCPSET;
5 |
6 | typedef void (MEMCALL * GDCPFN)(GDCPSET pen, UINT addr, UINT bit);
7 |
8 | struct _gdcpset {
9 | GDCPFN func[2];
10 | union {
11 | UINT8 *ptr; // raw access / grcg
12 | UINT32 addr; // egc
13 | } base;
14 | UINT16 pattern;
15 | PAIR16 update;
16 | UINT16 x;
17 | UINT16 y;
18 | UINT dots;
19 | };
20 |
21 |
22 | #ifdef __cplusplus
23 | extern "C" {
24 | #endif
25 |
26 | void MEMCALL gdcpset_prepare(GDCPSET pset, UINT32 csrw, REG16 pat, REG8 op);
27 | void MEMCALL gdcpset(GDCPSET pset, REG16 x, REG16 y);
28 |
29 | #ifdef __cplusplus
30 | }
31 | #endif
32 |
33 |
--------------------------------------------------------------------------------
/io/iocore16.tbl:
--------------------------------------------------------------------------------
1 |
2 | #define WORD_TERMINATE 0x2588
3 |
4 | // word terminate
5 | static const UINT8 word_term[] = {
6 | 0x01,0x03,0x05,0x07,0x09,0x0b,0x0d,0x0f,
7 | 0x15,0x19,0x1f,
8 | 0x21,0x23,0x25,0x27,0x29,
9 | 0xf2,0xf6};
10 |
11 | // active terminate
12 | static const UINT8 active_term[] = {
13 | 0xd0,0xd2,0xd4,0xd6,0xd8,0xdc,0xde};
14 |
15 | // upper +
16 | static const UINT8 plus_term[] = {
17 | 0x30,0x32,0x34,0x36,
18 | 0x40,0x42,0x44,0x46,
19 | 0x71,0x75,0x79,
20 | 0xad,0xaf};
21 |
22 | // upper -
23 | static const UINT8 minus_term[] = {
24 | 0x60,0x62,0x64,0x68,0x6a,0x6c,
25 | 0x70,0x72,0x74,0x76,0x7a,0x7c,
26 | 0xa0,0xa2,0xa4,0xa6,0xa8,0xac};
27 |
28 | // extend
29 | static const UINT8 ext08_term[] = {
30 | 0x20,0x22,0x24,0x26};
31 |
32 | typedef struct {
33 | const UINT8 *item;
34 | UINT items;
35 | } TERMTBL;
36 |
37 | enum {
38 | TERM_WORD = 1,
39 | TERM_ACTIVE = 2,
40 | TERM_PLUS = 3,
41 | TERM_MINUS = 4,
42 | TERM_EXT08 = 5
43 | };
44 |
45 | static const TERMTBL termtbl[] = {
46 | {word_term, sizeof(word_term)},
47 | {active_term, sizeof(active_term)},
48 | {plus_term, sizeof(plus_term)},
49 | {minus_term, sizeof(minus_term)},
50 | {ext08_term, sizeof(ext08_term)}};
51 |
52 |
--------------------------------------------------------------------------------
/io/lsidef.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | UINT8 porta;
4 | UINT8 portb;
5 | UINT8 portc;
6 | UINT8 mode;
7 | } uPD8255;
8 |
9 | enum {
10 | uPD8255_PORTCL = 0x01,
11 | uPD8255_PORTB = 0x02,
12 | uPD8255_GROUPB = 0x04,
13 | uPD8255_PORTCH = 0x08,
14 | uPD8255_PORTA = 0x10,
15 | uPD8255_GROUPA = 0x60,
16 | uPD8255_CTRL = 0x80
17 | };
18 |
19 |
--------------------------------------------------------------------------------
/io/mouseif.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | uPD8255 upd8255;
4 | UINT32 lastc;
5 | UINT32 intrclock;
6 | UINT32 moveclock;
7 | SINT16 x;
8 | SINT16 y;
9 | SINT16 rx;
10 | SINT16 ry;
11 | SINT16 sx;
12 | SINT16 sy;
13 | SINT16 latch_x;
14 | SINT16 latch_y;
15 | UINT8 timing;
16 | UINT8 rapid;
17 | UINT8 b;
18 | } _MOUSEIF, *MOUSEIF;
19 |
20 |
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | void mouseif_reset(const NP2CFG *pConfig);
26 | void mouseif_bind(void);
27 | void mouseif_sync(void);
28 | void mouseint(NEVENTITEM item);
29 |
30 | #ifdef __cplusplus
31 | }
32 | #endif
33 |
34 |
--------------------------------------------------------------------------------
/io/necio.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "cpucore.h"
3 | #include "pccore.h"
4 | #include "iocore.h"
5 |
6 |
7 | // ---- I/O
8 |
9 | static void IOOUTCALL necio_o0439(UINT port, REG8 dat) {
10 |
11 | necio.port0439 = dat;
12 | (void)port;
13 | }
14 |
15 | static void IOOUTCALL necio_o043d(UINT port, REG8 dat) {
16 |
17 | switch(dat) {
18 | case 0x10:
19 | CPU_ITFBANK = 1;
20 | break;
21 |
22 | case 0x12:
23 | CPU_ITFBANK = 0;
24 | break;
25 | }
26 | (void)port;
27 | }
28 |
29 |
30 | // ---- I/F
31 |
32 | void necio_reset(const NP2CFG *pConfig) {
33 |
34 | necio.port0439 = 0xff;
35 |
36 | (void)pConfig;
37 | }
38 |
39 | void necio_bind(void) {
40 |
41 | iocore_attachout(0x0439, necio_o0439);
42 |
43 | if (!(pccore.model & PCMODEL_EPSON)) {
44 | iocore_attachout(0x043d, necio_o043d);
45 | }
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/io/necio.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | UINT8 port0439;
4 | } _NECIO, *NECIO;
5 |
6 | #ifdef __cplusplus
7 | extern "C" {
8 | #endif
9 |
10 | void necio_reset(const NP2CFG *pConfig);
11 | void necio_bind(void);
12 |
13 | #ifdef __cplusplus
14 | }
15 | #endif
16 |
17 |
--------------------------------------------------------------------------------
/io/nmiio.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "pccore.h"
3 | #include "iocore.h"
4 |
5 |
6 | // ---- I/O
7 |
8 | static void IOOUTCALL nmiio_o50(UINT port, REG8 dat) {
9 |
10 | nmiio.enable = 0;
11 | (void)port;
12 | (void)dat;
13 | }
14 |
15 | static void IOOUTCALL nmiio_o52(UINT port, REG8 dat) {
16 |
17 | nmiio.enable = 1;
18 | (void)port;
19 | (void)dat;
20 | }
21 |
22 |
23 | // ---- I/F
24 |
25 | static const IOOUT nmiioo50[2] = {
26 | nmiio_o50, nmiio_o52};
27 |
28 | void nmiio_reset(const NP2CFG *pConfig) {
29 |
30 | ZeroMemory(&nmiio, sizeof(nmiio));
31 |
32 | (void)pConfig;
33 | }
34 |
35 | void nmiio_bind(void) {
36 |
37 | iocore_attachsysoutex(0x0050, 0x0cf1, nmiioo50, 2);
38 | // iocore_attachinp(0x98f0, nmiio_i98f0);
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/io/nmiio.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | int enable;
4 | } _NMIIO, *NMIIO;
5 |
6 |
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 |
11 | void nmiio_reset(const NP2CFG *pConfig);
12 | void nmiio_bind(void);
13 |
14 | #ifdef __cplusplus
15 | }
16 | #endif
17 |
18 |
--------------------------------------------------------------------------------
/io/np2sysp.h:
--------------------------------------------------------------------------------
1 |
2 | #define NP2SYSP_BIT 4
3 | #define NP2SYSP_LEN (1 << NP2SYSP_BIT)
4 | #define NP2SYSP_MASK (NP2SYSP_LEN - 1)
5 |
6 | typedef struct {
7 | char substr[NP2SYSP_LEN];
8 | char outstr[NP2SYSP_LEN];
9 | int strpos;
10 | int outpos;
11 | UINT32 outval;
12 | UINT32 inpval;
13 | } _NP2SYSP, *NP2SYSP;
14 |
15 |
16 | #ifdef __cplusplus
17 | extern "C" {
18 | #endif
19 |
20 | void np2sysp_outstr(const void *arg1, long arg2);
21 |
22 | void np2sysp_reset(const NP2CFG *pConfig);
23 | void np2sysp_bind(void);
24 |
25 | #ifdef __cplusplus
26 | }
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/io/pcidev.h:
--------------------------------------------------------------------------------
1 |
2 | // PC-9821 PCIブリッジ
3 |
4 | #if defined(SUPPORT_PC9821)
5 |
6 | typedef struct {
7 | UINT32 base;
8 |
9 | UINT8 membankd0;
10 | } _PCIDEV, *PCIDEV;
11 |
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif
16 |
17 | void IOOUTCALL pcidev_w32(UINT port, UINT32 value);
18 | UINT32 IOOUTCALL pcidev_r32(UINT port);
19 |
20 | void pcidev_reset(const NP2CFG *pConfig);
21 | void pcidev_bind(void);
22 |
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/io/printif.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void printif_reset(const NP2CFG *pConfig);
7 | void printif_bind(void);
8 |
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/io/serial.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | KB_CTR = (1 << 3),
4 | KB_CTRMASK = (KB_CTR - 1),
5 |
6 | KB_BUF = (1 << 7),
7 | KB_BUFMASK = (KB_BUF - 1)
8 | };
9 |
10 | typedef struct {
11 | UINT32 xferclock;
12 | UINT8 data;
13 | UINT8 cmd;
14 | UINT8 mode;
15 | UINT8 status;
16 | UINT ctrls;
17 | UINT ctrpos;
18 | UINT buffers;
19 | UINT bufpos;
20 | UINT8 ctr[KB_CTR];
21 | UINT8 buf[KB_BUF];
22 | } _KEYBRD, *KEYBRD;
23 |
24 | typedef struct {
25 | UINT8 result;
26 | UINT8 data;
27 | UINT8 send;
28 | UINT8 pad;
29 | UINT pos;
30 | UINT dummyinst;
31 | UINT mul;
32 | } _RS232C, *RS232C;
33 |
34 |
35 |
36 | #ifdef __cplusplus
37 | extern "C" {
38 | #endif
39 |
40 | void keyboard_callback(NEVENTITEM item);
41 |
42 | void keyboard_reset(const NP2CFG *pConfig);
43 | void keyboard_bind(void);
44 | void keyboard_resetsignal(void);
45 | void keyboard_ctrl(REG8 data);
46 | void keyboard_send(REG8 data);
47 |
48 |
49 |
50 | void rs232c_construct(void);
51 | void rs232c_destruct(void);
52 |
53 | void rs232c_reset(const NP2CFG *pConfig);
54 | void rs232c_bind(void);
55 | void rs232c_open(void);
56 | void rs232c_callback(void);
57 |
58 | UINT8 rs232c_stat(void);
59 | void rs232c_midipanic(void);
60 |
61 | #ifdef __cplusplus
62 | }
63 | #endif
64 |
65 |
--------------------------------------------------------------------------------
/io/sysport.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | UINT8 c;
4 | } _SYSPORT, *SYSPORT;
5 |
6 |
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 |
11 | void systemport_reset(const NP2CFG *pConfig);
12 | void systemport_bind(void);
13 |
14 | #ifdef __cplusplus
15 | }
16 | #endif
17 |
18 |
--------------------------------------------------------------------------------
/io/upd4990.h:
--------------------------------------------------------------------------------
1 |
2 | #define UPD4990_REGLEN 8
3 |
4 | typedef struct {
5 | UINT8 last;
6 | UINT8 cmd;
7 | UINT8 serial;
8 | UINT8 parallel;
9 | UINT8 reg[UPD4990_REGLEN];
10 | UINT pos;
11 | UINT8 cdat;
12 | UINT8 regsft;
13 | } _UPD4990, *UPD4990;
14 |
15 |
16 | #ifdef __cplusplus
17 | extern "C" {
18 | #endif
19 |
20 | void uPD4990_reset(const NP2CFG *pConfig);
21 | void uPD4990_bind(void);
22 |
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 |
27 |
--------------------------------------------------------------------------------
/mem/dmav30.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "cpucore.h"
3 | #include "pccore.h"
4 | #include "iocore.h"
5 | #include "dmav30.h"
6 |
7 |
8 | void dmav30(void) {
9 |
10 | DMACH ch;
11 | REG8 bit;
12 |
13 | if (dmac.working) {
14 | ch = dmac.dmach;
15 | bit = 1;
16 | do {
17 | if (dmac.working & bit) {
18 | // DMA working !
19 | if (!ch->leng.w) {
20 | dmac.stat |= bit;
21 | dmac.working &= ~bit;
22 | ch->proc.extproc(DMAEXT_END);
23 | }
24 | ch->leng.w--;
25 |
26 | switch(ch->mode & 0x0c) {
27 | case 0x00: // verifty
28 | ch->proc.inproc();
29 | break;
30 |
31 | case 0x04: // port->mem
32 | MEMP_WRITE8(ch->adrs.d, ch->proc.inproc());
33 | break;
34 |
35 | default:
36 | ch->proc.outproc(MEMP_READ8(ch->adrs.d));
37 | break;
38 | }
39 | ch->adrs.w[DMA16_LOW] += ((ch->mode & 0x20)?-1:1);
40 | }
41 | ch++;
42 | bit <<= 1;
43 | } while(bit & 0x0f);
44 | }
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/mem/dmav30.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void dmav30(void);
7 |
8 | #ifdef __cplusplus
9 | }
10 | #endif
11 |
12 |
--------------------------------------------------------------------------------
/mem/dmax86.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "cpucore.h"
3 | #include "pccore.h"
4 | #include "iocore.h"
5 | #include "dmax86.h"
6 |
7 |
8 | void dmax86(void) {
9 |
10 | DMACH ch;
11 | REG8 bit;
12 |
13 | if (dmac.working) {
14 | ch = dmac.dmach;
15 | bit = 1;
16 | do {
17 | if (dmac.working & bit) {
18 | // DMA working !
19 | if (!ch->leng.w) {
20 | dmac.stat |= bit;
21 | dmac.working &= ~bit;
22 | ch->proc.extproc(DMAEXT_END);
23 | }
24 | ch->leng.w--;
25 |
26 | switch(ch->mode & 0x0c) {
27 | case 0x00: // verifty
28 | ch->proc.inproc();
29 | break;
30 |
31 | case 0x04: // port->mem
32 | MEMP_WRITE8(ch->adrs.d, ch->proc.inproc());
33 | break;
34 |
35 | default:
36 | ch->proc.outproc(MEMP_READ8(ch->adrs.d));
37 | break;
38 | }
39 | ch->adrs.d += ((ch->mode & 0x20)?-1:1);
40 | }
41 | ch++;
42 | bit <<= 1;
43 | } while(bit & 0x0f);
44 | }
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/mem/dmax86.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void dmax86(void);
7 |
8 | #ifdef __cplusplus
9 | }
10 | #endif
11 |
12 |
--------------------------------------------------------------------------------
/mem/memegc.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void egcshift(void);
7 |
8 | REG8 MEMCALL egc_readbyte(UINT32 addr);
9 | void MEMCALL egc_writebyte(UINT32 addr, REG8 value);
10 | REG16 MEMCALL egc_readword(UINT32 addr);
11 | void MEMCALL egc_writeword(UINT32 addr, REG16 value);
12 |
13 | REG8 MEMCALL memegc_rd8(UINT32 addr);
14 | void MEMCALL memegc_wr8(UINT32 addr, REG8 value);
15 | REG16 MEMCALL memegc_rd16(UINT32 addr);
16 | void MEMCALL memegc_wr16(UINT32 addr, REG16 value);
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 |
22 |
--------------------------------------------------------------------------------
/mem/memems.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "cpucore.h"
3 | #include "pccore.h"
4 | #include "iocore.h"
5 | #include "memems.h"
6 |
7 |
8 | REG8 MEMCALL memems_rd8(UINT32 address) {
9 |
10 | return(CPU_EMSPTR[(address >> 14) & 3][LOW14(address)]);
11 | }
12 |
13 | REG16 MEMCALL memems_rd16(UINT32 address) {
14 |
15 | const UINT8 *ptr;
16 | REG16 ret;
17 |
18 | if ((address & 0x3fff) != 0x3fff) {
19 | ptr = CPU_EMSPTR[(address >> 14) & 3] + LOW14(address);
20 | return(LOADINTELWORD(ptr));
21 | }
22 | else {
23 | ret = CPU_EMSPTR[(address >> 14) & 3][0x3fff];
24 | ret += CPU_EMSPTR[((address + 1) >> 14) & 3][0] << 8;
25 | return(ret);
26 | }
27 | }
28 |
29 | void MEMCALL memems_wr8(UINT32 address, REG8 value) {
30 |
31 | CPU_EMSPTR[(address >> 14) & 3][LOW14(address)] = (UINT8)value;
32 | }
33 |
34 | void MEMCALL memems_wr16(UINT32 address, REG16 value) {
35 |
36 | UINT8 *ptr;
37 |
38 | if ((address & 0x3fff) != 0x3fff) {
39 | ptr = CPU_EMSPTR[(address >> 14) & 3] + LOW14(address);
40 | STOREINTELWORD(ptr, value);
41 | }
42 | else {
43 | CPU_EMSPTR[(address >> 14) & 3][0x3fff] = (UINT8)value;
44 | CPU_EMSPTR[((address + 1) >> 14) & 3][0] = (UINT8)(value >> 8);
45 | }
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/mem/memems.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | REG8 MEMCALL memems_rd8(UINT32 address);
7 | REG16 MEMCALL memems_rd16(UINT32 address);
8 | void MEMCALL memems_wr8(UINT32 address, REG8 value);
9 | void MEMCALL memems_wr16(UINT32 address, REG16 value);
10 |
11 | #ifdef __cplusplus
12 | }
13 | #endif
14 |
15 |
--------------------------------------------------------------------------------
/mem/memepp.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void MEMCALL memd000_wr8(UINT32 address, REG8 value);
7 | void MEMCALL memd000_wr16(UINT32 address, REG16 value);
8 |
9 | REG8 MEMCALL memf800_rd8(UINT32 address);
10 | REG16 MEMCALL memf800_rd16(UINT32 address);
11 |
12 | void MEMCALL memepson_wr8(UINT32 address, REG8 value);
13 | void MEMCALL memepson_wr16(UINT32 address, REG16 value);
14 |
15 | #ifdef __cplusplus
16 | }
17 | #endif
18 |
19 |
--------------------------------------------------------------------------------
/mem/memtram.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | REG8 MEMCALL memtram_rd8(UINT32 address);
7 | REG16 MEMCALL memtram_rd16(UINT32 address);
8 | void MEMCALL memtram_wr8(UINT32 address, REG8 value);
9 | void MEMCALL memtram_wr16(UINT32 address, REG16 value);
10 |
11 | #ifdef __cplusplus
12 | }
13 | #endif
14 |
15 |
--------------------------------------------------------------------------------
/mem/memvga.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(SUPPORT_PC9821)
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | REG8 MEMCALL memvgaf_rd8(UINT32 address);
9 | void MEMCALL memvgaf_wr8(UINT32 address, REG8 value);
10 | REG16 MEMCALL memvgaf_rd16(UINT32 address);
11 | void MEMCALL memvgaf_wr16(UINT32 address, REG16 value);
12 |
13 | REG8 MEMCALL memvga0_rd8(UINT32 address);
14 | REG8 MEMCALL memvga1_rd8(UINT32 address);
15 | void MEMCALL memvga0_wr8(UINT32 address, REG8 value);
16 | void MEMCALL memvga1_wr8(UINT32 address, REG8 value);
17 | REG16 MEMCALL memvga0_rd16(UINT32 address);
18 | REG16 MEMCALL memvga1_rd16(UINT32 address);
19 | void MEMCALL memvga0_wr16(UINT32 address, REG16 value);
20 | void MEMCALL memvga1_wr16(UINT32 address, REG16 value);
21 |
22 | REG8 MEMCALL memvgaio_rd8(UINT32 address);
23 | void MEMCALL memvgaio_wr8(UINT32 address, REG8 value);
24 | REG16 MEMCALL memvgaio_rd16(UINT32 address);
25 | void MEMCALL memvgaio_wr16(UINT32 address, REG16 value);
26 |
27 | #ifdef __cplusplus
28 | }
29 | #endif
30 |
31 | #endif
32 |
33 |
--------------------------------------------------------------------------------
/mem/memvram.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | REG8 MEMCALL memvram0_rd8(UINT32 address);
7 | REG8 MEMCALL memvram1_rd8(UINT32 address);
8 | REG16 MEMCALL memvram0_rd16(UINT32 address);
9 | REG16 MEMCALL memvram1_rd16(UINT32 address);
10 | void MEMCALL memvram0_wr8(UINT32 address, REG8 value);
11 | void MEMCALL memvram1_wr8(UINT32 address, REG8 value);
12 | void MEMCALL memvram0_wr16(UINT32 address, REG16 value);
13 | void MEMCALL memvram1_wr16(UINT32 address, REG16 value);
14 |
15 | REG8 MEMCALL memtcr0_rd8(UINT32 address);
16 | REG8 MEMCALL memtcr1_rd8(UINT32 address);
17 | REG16 MEMCALL memtcr0_rd16(UINT32 address);
18 | REG16 MEMCALL memtcr1_rd16(UINT32 address);
19 |
20 | void MEMCALL memrmw0_wr8(UINT32 address, REG8 value);
21 | void MEMCALL memrmw1_wr8(UINT32 address, REG8 value);
22 | void MEMCALL memrmw0_wr16(UINT32 address, REG16 value);
23 | void MEMCALL memrmw1_wr16(UINT32 address, REG16 value);
24 |
25 | void MEMCALL memtdw0_wr8(UINT32 address, REG8 value);
26 | void MEMCALL memtdw1_wr8(UINT32 address, REG8 value);
27 | void MEMCALL memtdw0_wr16(UINT32 address, REG16 value);
28 | void MEMCALL memtdw1_wr16(UINT32 address, REG16 value);
29 |
30 | #ifdef __cplusplus
31 | }
32 | #endif
33 |
34 |
--------------------------------------------------------------------------------
/np2tool/HOSTDRV.INC:
--------------------------------------------------------------------------------
1 |
2 | %define VERSION_ID "20040122"
3 |
4 |
5 | struc HDRVIF
6 | .drive_no resb 1
7 | .dosver resw 1
8 | .sda_off resw 1
9 | .sda_seg resw 1
10 | endstruc
11 |
12 | struc LOL
13 | resb 22
14 | .cds resd 1
15 | resb 7
16 | .lastdrv resb 1
17 | endstruc
18 |
19 | struc CDS
20 | .cur resb 67
21 | .flag resw 1
22 | resb 10
23 | .root resw 1
24 | .size
25 | endstruc
26 |
27 |
--------------------------------------------------------------------------------
/np2tool/Makefile.W32:
--------------------------------------------------------------------------------
1 | AS = nasmw
2 | AOPT = -f bin
3 |
4 | all: .\GETBIOS.COM .\PWOFF.COM .\HOSTDRV.COM
5 |
6 | .ASM{$(OBJ)}.COM:
7 | $(AS) $(*B).ASM $(AOPT) -o $*.COM -l $*.LST
8 |
9 | GETBIOS.COM :
10 | PWOFF.COM :
11 | HOSTDRV.COM :
12 |
13 |
--------------------------------------------------------------------------------
/np2tool/NP2TOOL.INC:
--------------------------------------------------------------------------------
1 |
2 | NP2PORT equ 07efh
3 | FIXCS equ 2eh
4 |
5 |
--------------------------------------------------------------------------------
/np2tool/NP2TOOL.X86:
--------------------------------------------------------------------------------
1 |
2 | ; in cld/ds=cs / ret z & bx
3 | np2_check: mov ah, 0fh
4 | int 10h
5 | cmp ah, 0fh
6 | mov bx, _msg_pcat
7 | jne short np2check_err
8 | add bx, byte 6
9 | mov si, bx
10 | call sendnp2port
11 | xchg si, bx
12 | checknp2port: lodsb
13 | mov cl, al
14 | .lp: in al, dx
15 | inc si
16 | cmp al, [si-1]
17 | loope .lp
18 | np2check_err: ret
19 |
20 | sendnp2port: mov dx, NP2PORT
21 | xor cx, cx
22 | lodsb
23 | mov cl, al
24 | .lp: lodsb
25 | out dx, al
26 | loop .lp
27 | ret
28 |
29 | _msg_pcat db 'PC/AT$'
30 | db 3, 'NP2'
31 | db 'Real PC-98x1$'
32 |
33 |
--------------------------------------------------------------------------------
/np2tool/POWEROFF.COM:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/np2tool/POWEROFF.COM
--------------------------------------------------------------------------------
/np2tool/PWOFF.ASM:
--------------------------------------------------------------------------------
1 |
2 | ORG 100h
3 | USE16
4 | CPU 8086
5 |
6 | %include 'np2tool.inc'
7 |
8 | START: cld
9 | push cs
10 | pop ds
11 | cli
12 | call np2_check
13 | jne short err_nonnp2
14 | call sendnp2port
15 | mov ax, 4c00h
16 | int 21h
17 |
18 | err_nonnp2: mov ah, 9
19 | mov dx, str_illegal
20 | int 21h
21 | mov ah, 9
22 | mov dx, bx
23 | int 21h
24 | mov ah, 9
25 | mov dx, str_crlf
26 | int 21h
27 | mov ax, 4c01h
28 | int 21h
29 |
30 |
31 | %include 'np2tool.x86'
32 | db 8, 'poweroff'
33 |
34 |
35 | str_illegal db 'Illegal hardware - $'
36 | str_crlf db 0dh, 0ah, '$'
37 |
38 | ends
39 |
40 |
--------------------------------------------------------------------------------
/np2tool/np2tool.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/np2tool/np2tool.zip
--------------------------------------------------------------------------------
/np2ver.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file np2ver.h
3 | * @brief The version
4 | */
5 |
6 | #if !defined(SUPPORT_PC9821)
7 | #define PROJECTNAME TEXT("Neko Project II - Debug Edition")
8 | #define SHORTNAME TEXT("np2")
9 | #else
10 | #define PROJECTNAME TEXT("Neko Project 21 - Debug Edition")
11 | #define SHORTNAME TEXT("np21")
12 | #endif
13 | #if !defined(_WIN64)
14 | #define PROJECTSUBNAME TEXT("")
15 | #else
16 | #define PROJECTSUBNAME TEXT(" x64")
17 | #endif
18 |
19 | #define NP2VER_CORE "ver.0.84"
20 |
21 | // #define NP2VER_WIN9X
22 | // #define NP2VER_MACOSX
23 | // #define NP2VER_X11
24 | // #define NP2VER_SDL2
25 |
26 |
--------------------------------------------------------------------------------
/romimage/BEEP.X86:
--------------------------------------------------------------------------------
1 | ; BEEP TEST
2 |
3 | beeptestwait: mov al, 4
4 | beeptestwaitlp1:mov cx, 9000h
5 | loop $ ; mine
6 | dec al
7 | jne beeptestwaitlp1
8 | ret
9 |
10 | BEEP_TEST: mov bx, 3e6h ; 2.0MHz
11 | in al, 42h
12 | test al, 20h
13 | jne short beephzok
14 | mov bx, 4cdh ; 2.5MHz
15 | beephzok: mov al, 76h
16 | out 77h, al ; BEEP setup mode#0
17 |
18 | cmp byte ptr ds:[MACTYPE], 0
19 | jne short beep_Hzset
20 |
21 | call beep_Hzset
22 | mov al, 6
23 | out 37h, al ; BEEP ON
24 | call beeptestwait
25 | shl bx, 1
26 | call beep_Hzset
27 | call beeptestwait
28 | mov al, 7
29 | out 37h, al ; BEEP OFF
30 | shr bx, 1
31 | beep_Hzset: mov al, bl
32 | out 73h, al
33 | mov al, bh
34 | out 73h, al
35 | ret
36 |
--------------------------------------------------------------------------------
/romimage/BIOS/EOI.X86:
--------------------------------------------------------------------------------
1 |
2 | sendeoi: push ax
3 | call eoi
4 | pop ax
5 | biosnop: iret
6 |
7 | eoi: mov al, 0bh
8 | out 00h, al
9 | out 5fh, al
10 | in al, 00h
11 | test al, 80h
12 | je short .master
13 | mov al, 20h
14 | out 08h, al
15 | out 5fh, al
16 | mov al, 0bh
17 | out 08h, al
18 | out 5fh, al
19 | in al, 08h
20 | test al, -1
21 | jne short .ed
22 | .master: mov al, 20h
23 | out 00h, al
24 | .ed: ret
25 |
26 |
--------------------------------------------------------------------------------
/romimage/BIOS/VECT02.X86:
--------------------------------------------------------------------------------
1 |
2 | perrbase db 'PARITY ERROR - BASE MEMORY', 0
3 | perrext db 'PARITY ERROR - EXTENDED MEMORY', 0
4 |
5 | vect02: push ax
6 | in al, 0x42
7 | test al, 0x06
8 | jne short .hlt
9 | pop ax
10 | iret
11 | .hlt: mov si, perrbase
12 | test al, 0x04
13 | jne short .disp
14 | mov si, perrext
15 | .disp: mov ax, 0xa000
16 | mov es, ax
17 | xor di, di
18 | cld
19 | in al, 0x31
20 | and ax, byte 0x04
21 | shr ax, 1
22 | inc ax
23 | mov dx, ax
24 |
25 | .loop: db FIXCS
26 | lodsb
27 | test al, -1
28 | je short .looped
29 | mov byte [es:di + 0x2000], 0x43
30 | stosb
31 | add di, dx
32 | jmp short .loop
33 | .looped: cli
34 | hlt
35 |
36 |
--------------------------------------------------------------------------------
/romimage/BIOS/VECT08.X86:
--------------------------------------------------------------------------------
1 |
2 | vect08: sti
3 | push ax
4 | push ds
5 | xor ax, ax
6 | mov ds, ax
7 | dec word [0x058a]
8 | pop ds
9 | cli
10 | je short .1
11 | mov al, 0x20
12 | out 0x00, al
13 | out 0x5f, al
14 | sti
15 | mov ah, 0x03
16 | int 0x1c
17 | pop ax
18 | iret
19 | .1: in al, 0x02
20 | or al, 0x01
21 | out 0x5f, al
22 | out 0x02, al
23 | mov al, 0x20
24 | out 0x00, al
25 | out 0x5f, al
26 | sti
27 | pop ax
28 | int 0x07
29 | iret
30 |
31 |
--------------------------------------------------------------------------------
/romimage/BIOS/VECT1A.X86:
--------------------------------------------------------------------------------
1 |
2 | vect1a: sti ; +00
3 | push ds ; +01
4 | push dx ; +02
5 | test ah, 0x10 ; +03
6 | jne short .prt ; +06
7 | call bios1a_cmt ; +08
8 | jmp short .ed ; +0b
9 | times (0x19 - 0x0d) nop ; +0d
10 | .prt: call bios1a_prt ; +19 (use dos6.20)
11 | .ed: pop dx
12 | pop ds
13 | iret
14 |
15 |
--------------------------------------------------------------------------------
/romimage/BIOS/vect09.x86:
--------------------------------------------------------------------------------
1 |
2 | vect09: sti
3 | push ax
4 | push ds
5 | xor ax, ax
6 | mov ds, ax
7 | in al, 0x43
8 | test al, 0x38
9 | jne short .err
10 | .force: mov al, 0x16
11 | out 0x43, al
12 | mov byte [0x0529], 0
13 | in al, 0x41
14 | mov ah, al
15 | call bios09
16 | .eoi: pop ds
17 | cli
18 | mov al, 0x20
19 | out 0x00, al
20 | cmp ah, 0x60
21 | je short .int6
22 | cmp ah, 0x61
23 | je short .int5
24 | pop ax
25 | iret
26 | .err: cmp byte [0x0529], 3
27 | jae short .force
28 | inc byte [0x0529]
29 | mov al, 0x14
30 | out 0x43, al
31 | in al, 0x41
32 | jmp short .eoi
33 |
34 | .int5: pop ax
35 | int 0x05
36 | iret
37 |
38 | .int6: pop ax
39 | int 0x06
40 | iret
41 |
42 |
--------------------------------------------------------------------------------
/romimage/DATASEG.INC:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/romimage/DATASEG.INC
--------------------------------------------------------------------------------
/romimage/DEBUG.MAC:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/romimage/DEBUG.MAC
--------------------------------------------------------------------------------
/romimage/HDDBOOT.ASM:
--------------------------------------------------------------------------------
1 |
2 | ORG 0
3 | USE16
4 | CPU 8086
5 |
6 | FIXCS equ 2eh
7 |
8 | segment .hddboot start=0x0000
9 |
10 | START: jmp short main
11 | nop
12 | nop
13 | db "IPL1", 0, 0, 0, 0x1e
14 |
15 | main: mov ax, 0x0a04
16 | int 0x18
17 | mov ah, 0x16
18 | mov dx, 0xe120
19 | int 0x18
20 | cli
21 | cld
22 | mov ax, 0xa000
23 | mov es, ax
24 | mov si, nosysmsg
25 | xor di, di
26 | call putmsg
27 | mov di, 160
28 | call putmsg
29 | .hlt: hlt
30 | jmp short .hlt
31 |
32 | putmsg: db FIXCS
33 | lodsw
34 | test ax, ax
35 | je short .end
36 | stosw
37 | inc di
38 | inc di
39 | jmp short putmsg
40 | .end: ret
41 |
42 |
43 | ; このハードディスクイメージはフォーマットされていません.
44 | nosysmsg dw 3304h,4e04h,4f05h,3c01h,4905h,4705h,2305h,3905h
45 | dw 2f05h,2405h,6105h,3c01h,3805h,4f04h,5505h,2905h
46 | dw 3c01h,5e05h,4305h,4805h,3504h,6c04h,4604h,2404h
47 | dw 5e04h,3b04h,7304h,2501h, 0
48 |
49 | ; ディスクイメージを挿入後,リセットして下さい.
50 | dw 4705h,2305h,3905h,2f05h,2405h,6105h,3c01h,3805h
51 | dw 7204h,5e21h,7e26h,6518h,2401h,6a05h,3b05h,4305h
52 | dw 4805h,3704h,4604h,3c12h,3504h,2404h,2501h,0
53 |
54 | ends
55 |
56 |
--------------------------------------------------------------------------------
/romimage/ITF.INC:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/romimage/ITF.INC
--------------------------------------------------------------------------------
/romimage/ITF.MK:
--------------------------------------------------------------------------------
1 | AS = masm
2 | AOPT = /ML /DNP2
3 | OBJ = ..\obj\romrel
4 |
5 | ..\bios\itfrom.res: $(OBJ) $(OBJ)\itf.bin
6 | bin2txt $(OBJ)\itf.bin itfrom > ..\bios\itfrom.res
7 |
8 | $(OBJ):
9 | if not exist $(OBJ) mkdir $(OBJ)
10 |
11 | $(OBJ)\itf.bin: $(OBJ)\itf.exe
12 | exe2bin $(OBJ)\itf $(OBJ)\itf.bin
13 |
14 | $(OBJ)\itf.exe: $(OBJ)\itf.obj
15 | link $(OBJ)\itf,$(OBJ)\itf;
16 |
17 | $(OBJ)\itf.obj: itf.asm itf.inc dataseg.inc process.mac debug.mac \
18 | resource.x86 itfsub.x86 \
19 | keyboard.inc keyboard.x86 textdisp.x86 \
20 | np2.x86 dipsw.x86 memsw.x86 \
21 | beep.x86 firmware.x86 memchk.x86 \
22 | ssp.x86 ssp_res.x86 ssp_sub.x86 ssp_dip.x86 ssp_msw.x86
23 | $(AS) $(AOPT) $(*B),$*,$*;
24 |
25 | resource.x86: resource.txt
26 | txtpack resource.txt > resource.x86
27 |
--------------------------------------------------------------------------------
/romimage/ITFD.MK:
--------------------------------------------------------------------------------
1 | AS = masm
2 | AOPT = /ML /DMSDOS /DDEBUG
3 | OBJ = DEBUG
4 |
5 | itf.com: $(OBJ)\itf.exe
6 | exe2bin $(OBJ)\itf itf.com
7 |
8 | $(OBJ)\itf.exe: $(OBJ)\itf.obj
9 | link $(OBJ)\itf,$(OBJ)\itf;
10 |
11 | $(OBJ)\itf.obj: itf.asm itf.inc dataseg.inc process.mac debug.mac \
12 | resource.x86 itfsub.x86 \
13 | keyboard.inc keyboard.x86 textdisp.x86 \
14 | np2.x86 dipsw.x86 memsw.x86 \
15 | beep.x86 firmware.x86 memchk.x86 \
16 | ssp.x86 ssp_res.x86 ssp_sub.x86 ssp_dip.x86 ssp_msw.x86
17 | $(AS) $(AOPT) $(*B),$*;
18 |
19 | resource.x86: resource.txt
20 | tool\txtpack resource.txt > resource.x86
21 |
--------------------------------------------------------------------------------
/romimage/ITFSUB.X86:
--------------------------------------------------------------------------------
1 |
2 | WAITVSYNC1: push ax
3 | mov ah, 1
4 | jmps waitvsync_lp1
5 | WAITVSYNC: push ax
6 | waitvsync_lp1: in al, 0a0h
7 | test al, 20h
8 | jne waitvsync_lp1
9 | waitvsync_lp2: in al, 0a0h
10 | test al, 20h
11 | je waitvsync_lp2
12 | dec ah
13 | jne waitvsync_lp1
14 | pop ax
15 | ret
16 |
--------------------------------------------------------------------------------
/romimage/KEYBOARD.INC:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/romimage/KEYBOARD.INC
--------------------------------------------------------------------------------
/romimage/MEMSW.X86:
--------------------------------------------------------------------------------
1 |
2 | mswdefault db 048h, 005h, 004h, 000h, 001h, 000h, 000h, 06Eh
3 |
4 | MEMSW_INIT: mov si, offset mswdefault
5 | mov di, MEM_MSW1
6 | cli
7 | mov al, 0dh
8 | out 68h, al ; memsw write enable
9 | mov cx, 8
10 | mswresetlp: db FIXCS
11 | movsb
12 | add di, 3
13 | loop mswresetlp
14 | mov al, 0ch
15 | out 68h, al ; memsw write disable
16 | sti
17 | ret
18 |
--------------------------------------------------------------------------------
/romimage/PC98.INC:
--------------------------------------------------------------------------------
1 |
2 | ;seg=00000h
3 | MEM_EXPMMSZ equ 00401h
4 |
5 | MEM_KB_KY_STS equ 0052ah
6 | MEM_SHIFT_STS equ 0053ah
7 | MEM_EXTMSZ equ 00594h
8 |
9 | ;seg=0a000h
10 | MEM_MSW1 equ 03fe2h
11 | MEM_MSW2 equ 03fe6h
12 | MEM_MSW3 equ 03feah
13 | MEM_MSW4 equ 03feeh
14 | MEM_MSW5 equ 03ff2h
15 | MEM_MSW6 equ 03ff6h
16 | MEM_MSW7 equ 03ffah
17 | MEM_MSW8 equ 03ffeh
18 |
--------------------------------------------------------------------------------
/romimage/PROCESS.MAC:
--------------------------------------------------------------------------------
1 |
2 | ifdef NP2
3 | ITF_EXIT macro
4 | mov al, 0fh
5 | out 37h, al
6 | mov al, 0ah
7 | out 37h, al
8 | mov ax, 0
9 | mov ds, ax
10 | itfexitp: mov word ptr ds:[04f8h], 0eaeeh
11 | mov word ptr ds:[04fah], 00008h
12 | mov word ptr ds:[04fch], 0fd80h
13 | mov dx, 043dh
14 | mov al, 12h
15 | db 0eah
16 | dw 04f8h
17 | dw 0000h
18 | endm
19 | endif
20 |
21 |
22 | ifdef MSDOS
23 | ITF_EXIT macro
24 | mov ax, 4c00h
25 | int 21h
26 | endm
27 | endif
28 |
29 |
--------------------------------------------------------------------------------
/romimage/RESOURCE.TXT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/romimage/RESOURCE.TXT
--------------------------------------------------------------------------------
/romimage/SSP_SUB.X86:
--------------------------------------------------------------------------------
1 | ssp_resdisp: xor di, di
2 | mov cx, 1950h
3 | call boxclear
4 | ssp_rboxdisp: db FIXCS
5 | lodsb
6 | cmp al, 0
7 | je short ssp_rtxtdisp
8 | mov cl, al
9 | db FIXCS
10 | lodsw
11 | mov dx, ax
12 | db FIXCS
13 | lodsw
14 | mov bx, ax
15 | call puttextbox
16 | jmps ssp_rboxdisp
17 | ssp_rtxtdisp: db FIXCS
18 | lodsb
19 | cmp al, 0
20 | je ssp_resdsp_ed
21 | mov cl, al
22 | db FIXCS
23 | lodsw
24 | mov dx, ax
25 | db FIXCS
26 | lodsw
27 | push si
28 | mov si, ax
29 | call disptextjis
30 | pop si
31 | jmps ssp_rtxtdisp
32 | ssp_resdsp_ed: ret
33 |
34 |
35 |
36 | ssp_keyevent: push ax
37 | keyeventst: mov al, -1
38 | keyeventlp: out 5fh, al
39 | xchg al, ds:[KEYSTAT]
40 | out 5fh, al
41 | cmp al, -1
42 | je keyeventlp
43 | push si
44 | keyeventsea: mov ah, cs:[si]
45 | cmp ah, al
46 | je keyeventhit
47 | add si, 3
48 | cmp ah, -1
49 | jne keyeventsea
50 | pop si
51 | jmps keyeventst
52 | keyeventhit: pop ax
53 | pop ax
54 | jmp word ptr cs:[si+1]
55 |
56 |
57 |
--------------------------------------------------------------------------------
/romimage/STARTUP.ASM:
--------------------------------------------------------------------------------
1 |
2 | ORG 0
3 | USE16
4 | CPU 8086
5 |
6 | FIXCS equ 2eh
7 |
8 | segment .startup start=0x0000
9 |
10 | START: jmp short nosystems
11 | START2: mov si, nobiosmsg
12 | jmp short dispend
13 |
14 | nosystems: mov si, nosysmsg
15 |
16 | dispend: mov ax, 0x0a04
17 | int 0x18
18 | mov ah, 0x0c
19 | int 0x18
20 | mov ah, 0x16
21 | mov dx, 0xe120
22 | int 0x18
23 | cli
24 | cld
25 | mov ax, 0xa000
26 | mov es, ax
27 | db FIXCS
28 | lodsw
29 | mov di, ax
30 | .loop: db FIXCS
31 | lodsw
32 | test ax, ax
33 | je short .end
34 | stosw
35 | or ah, ah
36 | je short .loop
37 | inc di
38 | inc di
39 | jmp short .loop
40 |
41 | .end: hlt
42 | jmp short .end
43 |
44 |
45 | ; システムディスクをセットしてください
46 | nosysmsg dw 12*160+44
47 | dw 3705h,3905h,4605h,6005h,4705h,2305h,3905h,2f05h
48 | dw 7204h,3b05h,4305h,4805h,3704h,4604h,2f04h,4004h
49 | dw 3504h,2404h,0
50 |
51 | ; BASICの起動には BIOS.ROMが必要です
52 | nobiosmsg dw 12*160+46
53 | dw 0042h,0041h,0053h,0049h,0043h,4e04h,2f15h,3026h
54 | dw 4b04h,4f04h,0020h,0042h,0049h,004fh,0053h,002eh
55 | dw 0052h,004fh,004dh,2c04h,2c29h,572dh,4704h,3904h,0
56 |
57 | ends
58 |
59 |
--------------------------------------------------------------------------------
/romimage/readme.txt:
--------------------------------------------------------------------------------
1 |
2 | NP2が抱き込んでいる 各種ROMイメージのソースです。
3 | MASM5.1 + EXE2BINです。
4 |
5 | NP2をビルドする時には、アセンブルの必要はありません。
6 |
7 |
--------------------------------------------------------------------------------
/romimage/tool/BIN2TXT.C:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/romimage/tool/BIN2TXT.C
--------------------------------------------------------------------------------
/romimage/tool/BIN2TXT.LK:
--------------------------------------------------------------------------------
1 | ..\..\obj\romtool\bin2txt+
2 | ..\..\obj\romtool\dosio32
3 | ..\bin2txt;
4 |
--------------------------------------------------------------------------------
/romimage/tool/COMMON.H:
--------------------------------------------------------------------------------
1 | #ifndef NULL
2 | #define NULL ((void *)0)
3 | #endif
4 |
5 | #ifndef FALSE
6 | #define FALSE 0
7 | #define TRUE 1
8 | #endif
9 |
10 | #define SUCCESS 0
11 | #define FAILURE -1
12 |
13 | typedef unsigned char BYTE;
14 | typedef unsigned short WORD;
15 | typedef unsigned long DWORD;
16 |
--------------------------------------------------------------------------------
/romimage/tool/DOSIO.H:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/romimage/tool/DOSIO.H
--------------------------------------------------------------------------------
/romimage/tool/MIL.INC:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/romimage/tool/MIL.INC
--------------------------------------------------------------------------------
/romimage/tool/ROMTOOL.MK:
--------------------------------------------------------------------------------
1 | AOPT = /MX
2 | COPT = -c -AS -W3 -Gs -Ot -Zp1 -G2
3 | LOPT = /NOI /CP:1 /ST:8192
4 |
5 | CC = cl
6 | AS = masm
7 | OBJ = ..\..\obj\romtool
8 |
9 | BTOBJ = $(OBJ)\bin2txt.obj \
10 | $(OBJ)\dosio32.obj
11 | BTBIN = ..\bin2txt.exe
12 |
13 | TPOBJ = $(OBJ)\txtpack.obj \
14 | $(OBJ)\dosio32.obj
15 | TPBIN = ..\txtpack.exe
16 |
17 | all: $(OBJ) $(BTBIN) $(TPBIN)
18 |
19 | $(OBJ):
20 | if not exist $(OBJ) mkdir $(OBJ)
21 |
22 | $(BTBIN): $(BTOBJ)
23 | link $(LOPT) @bin2txt.lk;
24 |
25 | $(TPBIN): $(TPOBJ)
26 | link $(LOPT) @txtpack.lk;
27 |
28 | .asm{$(OBJ)}.obj:
29 | $(AS) $(AOPT) $(*B),$*;
30 |
31 | .c{$(OBJ)}.obj:
32 | $(CC) $(COPT) -Fo$* $(*B).c
33 |
34 | $(OBJ)\bin2txt.obj : common.h dosio.h
35 | $(OBJ)\txtpack.obj : common.h dosio.h
36 | $(OBJ)\dosio32.obj : mil.inc
37 |
38 |
--------------------------------------------------------------------------------
/romimage/tool/TXTPACK.C:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/romimage/tool/TXTPACK.C
--------------------------------------------------------------------------------
/romimage/tool/TXTPACK.LK:
--------------------------------------------------------------------------------
1 | ..\..\obj\romtool\txtpack+
2 | ..\..\obj\romtool\dosio32
3 | ..\txtpack;
4 |
--------------------------------------------------------------------------------
/sdl2/MacOSX/np2sdl2/compiler.pch:
--------------------------------------------------------------------------------
1 | /**
2 | * @file compiler.pch
3 | * @brief プリコンパイル済みヘッダー
4 | */
5 |
6 | #ifndef np2sdl2_compiler_pch
7 | #define np2sdl2_compiler_pch
8 |
9 | // Include any system framework and library headers here that should be included in all compilation units.
10 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
11 | #include "compiler.h"
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/sdl2/MacOSX/np2sdl2/en.lproj/Credits.rtf:
--------------------------------------------------------------------------------
1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
2 | {\colortbl;\red255\green255\blue255;}
3 | \paperw9840\paperh8400
4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
5 |
6 | \f0\b\fs24 \cf0 Engineering:
7 | \b0 \
8 | Some people\
9 | \
10 |
11 | \b Human Interface Design:
12 | \b0 \
13 | Some other people\
14 | \
15 |
16 | \b Testing:
17 | \b0 \
18 | Hopefully not nobody\
19 | \
20 |
21 | \b Documentation:
22 | \b0 \
23 | Whoever\
24 | \
25 |
26 | \b With special thanks to:
27 | \b0 \
28 | Mom\
29 | }
30 |
--------------------------------------------------------------------------------
/sdl2/MacOSX/np2sdl2/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/sdl2/MacOSX/np2sdl2/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * @file main.m
3 | * @brief メイン
4 | */
5 |
6 | #include "compiler.h"
7 | #include "../../np2.h"
8 | #include "../../dosio.h"
9 |
10 | /**
11 | * メイン
12 | * @param[in] argc 引数
13 | * @param[in] argv 引数
14 | * @return リザルト コード
15 | */
16 | int main(int argc, char * argv[])
17 | {
18 | NSString *pstrBundlePath = [[NSBundle mainBundle] bundlePath];
19 | file_setcd([pstrBundlePath UTF8String]);
20 |
21 | for (int i = 1; i < argc; i++)
22 | {
23 | if (strncmp(argv[i], "-psn_", 5) == 0)
24 | {
25 | argc--;
26 | memmove(argv + i, argv + i + 1, (argc - i + 1) * sizeof(argv[0]));
27 | break;
28 | }
29 | }
30 |
31 | return np2_main(argc, argv);
32 | }
33 |
--------------------------------------------------------------------------------
/sdl2/MacOSX/np2sdl2/misc/guard.h:
--------------------------------------------------------------------------------
1 | /*!
2 | * @file guard.h
3 | * @brief クリティカル セクション クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | #include
9 |
10 | /*!
11 | * @brief クリティカル セクション クラス
12 | */
13 | class CGuard
14 | {
15 | public:
16 | /*! コンストラクタ */
17 | CGuard() { ::pthread_mutex_init(&m_cs, NULL); }
18 |
19 | /*! デストラクタ */
20 | ~CGuard() { ::pthread_mutex_destroy(&m_cs); }
21 |
22 | /*! クリティカル セクション開始 */
23 | void Enter() { ::pthread_mutex_lock(&m_cs); }
24 |
25 | /*! クリティカル セクション終了 */
26 | void Leave() { ::pthread_mutex_unlock(&m_cs); }
27 |
28 | private:
29 | pthread_mutex_t m_cs; //!< クリティカル セクション情報
30 | };
31 |
--------------------------------------------------------------------------------
/sdl2/MacOSX/np2sdl2/misc/threadbase.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file threadbase.h
3 | * @brief スレッド基底クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | #include
9 | #include
10 |
11 | /**
12 | * @brief スレッド基底クラス
13 | */
14 | class CThreadBase
15 | {
16 | public:
17 | CThreadBase();
18 | virtual ~CThreadBase();
19 |
20 | bool Start();
21 | void Stop();
22 | void SetStackSize(size_t stack_size);
23 | static void Delay(unsigned int usec);
24 |
25 | protected:
26 | virtual bool Task()=0; //!< スレッド タスク
27 |
28 | private:
29 | pthread_t m_thread; //!< スレッド フラグ
30 | bool m_bCreated; //!< スレッド作成フラグ
31 | bool m_bDone; //!< 終了フラグ
32 | size_t m_stack_size; //!< スタック サイズ
33 | static void* StartRoutine(void* arg);
34 | };
35 |
36 | /**
37 | * スタック サイズの設定
38 | * @param[in] stack_size スタック サイズ
39 | */
40 | inline void CThreadBase::SetStackSize(size_t stack_size)
41 | {
42 | m_stack_size = stack_size;
43 | }
44 |
45 | /**
46 | * スリープ
47 | * @param[in] usec マイクロ秒
48 | */
49 | inline void CThreadBase::Delay(unsigned int usec)
50 | {
51 | ::usleep(usec);
52 | }
53 |
--------------------------------------------------------------------------------
/sdl2/MacOSX/np2sdl2/misc/tty.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file tty.h
3 | * @brief シリアル通信クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | #include
9 |
10 | /**
11 | * @brief シリアル通信
12 | */
13 | class CTty
14 | {
15 | public:
16 | CTty();
17 | ~CTty();
18 | bool Open(const char* dev, unsigned int speed = 0, const char* param = NULL);
19 | void Close();
20 | ssize_t Read(void* data_ptr, ssize_t data_size);
21 | ssize_t Write(const void* data_ptr, ssize_t data_size);
22 | bool IsOpened() const;
23 |
24 | private:
25 | int m_fd; //!< ファイル ディスクリプタ
26 | static bool SetParam(const char* param, tcflag_t* cflag_ptr);
27 | };
28 |
29 | /**
30 | * オープン済?
31 | * @retval true オープン済
32 | * @retval false 未オープン
33 | */
34 | inline bool CTty::IsOpened() const
35 | {
36 | return (m_fd >= 0);
37 | }
38 |
--------------------------------------------------------------------------------
/sdl2/MacOSX/np2sdl2/misc/usbdev.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file usbdev.h
3 | * @brief USB アクセス クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | #include
9 |
10 | /**
11 | * @brief USB アクセス クラス
12 | */
13 | class CUsbDev
14 | {
15 | public:
16 | CUsbDev();
17 | ~CUsbDev();
18 | bool Open(unsigned int vid, unsigned int pid);
19 | void Close();
20 | int CtrlXfer(int nType, int nRequest, int nValue = 0, int nIndex = 0, void* lpBuffer = NULL, int cbBuffer = 0);
21 | int WriteBulk(const void* lpBuffer, int cbBuffer);
22 | int ReadBulk(void* lpBuffer, int cbBuffer);
23 | bool IsOpened() const;
24 |
25 | private:
26 | IOUSBDeviceInterface** m_device; /*!< デバイス */
27 | IOUSBInterfaceInterface** m_interface; /*!< インタフェイス */
28 | static IOReturn ConfigureDevice(IOUSBDeviceInterface** dev);
29 | };
30 |
31 | /**
32 | * オープン済?
33 | * @retval true オープン済
34 | * @retval false 未オープン
35 | */
36 | inline bool CUsbDev::IsOpened() const
37 | {
38 | return (m_interface != NULL);
39 | }
40 |
--------------------------------------------------------------------------------
/sdl2/MacOSX/np2sdl2/np2.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/sdl2/MacOSX/np2sdl2/np2.icns
--------------------------------------------------------------------------------
/sdl2/MacOSX/np2sdl2/np2sdl2-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIconFile
10 | np2.icns
11 | CFBundleIdentifier
12 | jp.ne.yui.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | ${MACOSX_DEPLOYMENT_TARGET}
27 | NSHumanReadableCopyright
28 | Copyright © 2014年 Yui. All rights reserved.
29 | NSMainNibFile
30 | MainMenu
31 | NSPrincipalClass
32 | NSApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/sdl2/commng.h:
--------------------------------------------------------------------------------
1 |
2 | // ---- com manager interface
3 |
4 | enum {
5 | COMCREATE_SERIAL = 0,
6 | COMCREATE_PC9861K1,
7 | COMCREATE_PC9861K2,
8 | COMCREATE_PRINTER,
9 | COMCREATE_MPU98II
10 | };
11 |
12 | enum {
13 | COMCONNECT_OFF = 0,
14 | COMCONNECT_SERIAL,
15 | COMCONNECT_MIDI,
16 | COMCONNECT_PARALLEL
17 | };
18 |
19 | enum {
20 | COMMSG_MIDIRESET = 0,
21 | COMMSG_SETFLAG,
22 | COMMSG_GETFLAG,
23 | COMMSG_USER
24 | };
25 |
26 | struct _commng;
27 | typedef struct _commng _COMMNG;
28 | typedef struct _commng *COMMNG;
29 |
30 | struct _commng {
31 | UINT connect;
32 | UINT (*read)(COMMNG self, UINT8 *data);
33 | UINT (*write)(COMMNG self, UINT8 data);
34 | UINT8 (*getstat)(COMMNG self);
35 | INTPTR (*msg)(COMMNG self, UINT msg, INTPTR param);
36 | void (*release)(COMMNG self);
37 | };
38 |
39 | typedef struct {
40 | UINT32 size;
41 | UINT32 sig;
42 | UINT32 ver;
43 | UINT32 param;
44 | } _COMFLAG, *COMFLAG;
45 |
46 |
47 | #ifdef __cplusplus
48 | extern "C" {
49 | #endif
50 |
51 | COMMNG commng_create(UINT device);
52 | void commng_destroy(COMMNG hdl);
53 |
54 | #ifdef __cplusplus
55 | }
56 | #endif
57 |
58 |
59 | // ----
60 |
61 | void commng_initialize(void);
62 |
63 |
--------------------------------------------------------------------------------
/sdl2/ext/externalchip.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file externalchip.h
3 | * @brief Interface of thg external modules
4 | */
5 |
6 | #pragma once
7 |
8 | /**
9 | * @brief The interface of thg external modules
10 | */
11 | class IExternalChip
12 | {
13 | public:
14 | /**
15 | * ChipType
16 | */
17 | enum ChipType
18 | {
19 | kNone = 0,
20 | kYM2608,
21 | kYM3438,
22 | kYMF288
23 | };
24 |
25 | /**
26 | * MessageType
27 | */
28 | enum
29 | {
30 | kMute = 0,
31 | kBusy
32 | };
33 |
34 | /**
35 | * Destructor
36 | */
37 | virtual ~IExternalChip() { }
38 |
39 | /**
40 | * Get chip type
41 | * @return The type of the chip
42 | */
43 | virtual ChipType GetChipType() = 0;
44 |
45 | /**
46 | * Reset
47 | */
48 | virtual void Reset() = 0;
49 |
50 | /**
51 | * Writes register
52 | * @param[in] nAddr The address
53 | * @param[in] cData The data
54 | */
55 | virtual void WriteRegister(UINT nAddr, UINT8 cData) = 0;
56 |
57 | /**
58 | * Message
59 | * @param[in] nMessage The message
60 | * @param[in] nParameter The parameter
61 | * @return Result
62 | */
63 | virtual INTPTR Message(UINT nMessage, INTPTR nParameter = 0) = 0;
64 | };
65 |
--------------------------------------------------------------------------------
/sdl2/ext/externalchipmanager.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file externalchipmanager.h
3 | * @brief 外部チップ管理クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | #include "externalchip.h"
9 |
10 | /**
11 | * @brief 外部チップ管理クラス
12 | */
13 | class CExternalChipManager
14 | {
15 | public:
16 | static CExternalChipManager* GetInstance();
17 |
18 | CExternalChipManager();
19 | ~CExternalChipManager();
20 | void Initialize();
21 | void Deinitialize();
22 | IExternalChip* GetInterface(IExternalChip::ChipType nChipType, UINT nClock);
23 | void Release(IExternalChip* pChip);
24 | void Reset();
25 | void Mute(bool bMute);
26 |
27 | private:
28 | static CExternalChipManager sm_instance; //!< 唯一のインスタンスです
29 |
30 | IExternalChip* m_pGimic;
31 | IExternalChip* m_pLight;
32 |
33 | IExternalChip* GetInterfaceInner(IExternalChip::ChipType nChipType, UINT nClock);
34 | };
35 |
36 | /**
37 | * インスタンスを得る
38 | * @return インスタンス
39 | */
40 | inline CExternalChipManager* CExternalChipManager::GetInstance()
41 | {
42 | return &sm_instance;
43 | }
44 |
--------------------------------------------------------------------------------
/sdl2/ext/gimic/gimic.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/sdl2/ext/gimic/gimic.cpp
--------------------------------------------------------------------------------
/sdl2/ext/gimic/gimic.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file gimic.h
3 | * @brief Interface of accessing G.I.M.I.C
4 | */
5 |
6 | #pragma once
7 |
8 | #include "../externalchip.h"
9 |
10 | namespace c86ctl
11 | {
12 | class IC86RealChip;
13 | }
14 |
15 | /**
16 | * @brief The class of accessing G.I.M.I.C
17 | */
18 | class CGimic : public IExternalChip
19 | {
20 | public:
21 | CGimic();
22 | virtual ~CGimic();
23 | bool Initialize(IExternalChip::ChipType nChipType, UINT nClock);
24 | void Deinitialize();
25 | virtual ChipType GetChipType();
26 | virtual void Reset();
27 | virtual void WriteRegister(UINT nAddr, UINT8 cData);
28 | virtual INTPTR Message(UINT nMessage, INTPTR nParameter = 0);
29 |
30 | private:
31 | c86ctl::IC86RealChip* m_pChip; /*!< The instance of the chip */
32 | UINT m_nClock; /*!< The clock */
33 | static IExternalChip::ChipType GetChipTypeInner(c86ctl::IC86RealChip* pDevice);
34 | };
35 |
--------------------------------------------------------------------------------
/sdl2/ext/spfm/spfmlight.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file spfmlight.h
3 | * @brief Interface of accessing SPFM Light
4 | */
5 |
6 | #pragma once
7 |
8 | #include "../externalchip.h"
9 | #include "misc/tty.h"
10 |
11 | /**
12 | * @brief The class of SPFM
13 | */
14 | class CSpfmLight : public IExternalChip
15 | {
16 | public:
17 | CSpfmLight();
18 | virtual ~CSpfmLight();
19 | bool Initialize(IExternalChip::ChipType nChipType, UINT nClock);
20 | void Deinitialize();
21 | virtual ChipType GetChipType();
22 | virtual void Reset();
23 | virtual void WriteRegister(UINT nAddr, UINT8 cData);
24 | virtual INTPTR Message(UINT nMessage, INTPTR nParameter = 0);
25 |
26 | private:
27 | /**
28 | * Sound chip list
29 | */
30 | enum SC_CHIP_TYPE
31 | {
32 | SC_TYPE_NONE = 0,
33 | SC_TYPE_YM2608,
34 | SC_TYPE_YM2151,
35 | SC_TYPE_YM2610,
36 | SC_TYPE_YM2203,
37 | SC_TYPE_YM2612,
38 | SC_TYPE_AY8910,
39 | SC_TYPE_SN76489,
40 | SC_TYPE_YM3812,
41 | SC_TYPE_YMF262,
42 | SC_TYPE_YM2413,
43 | SC_TYPE_YM3526,
44 | SC_TYPE_YMF288,
45 | SC_TYPE_SCC,
46 | SC_TYPE_SCCS,
47 | SC_TYPE_Y8950,
48 | SC_TYPE_MAX
49 | };
50 |
51 | CTty m_serial; /*!< Serial */
52 | SC_CHIP_TYPE m_nScChipType; /*!< ChipType */
53 | bool Open(const OEMCHAR* lpDeviceName);
54 | };
55 |
--------------------------------------------------------------------------------
/sdl2/fontmng.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file fongmng.h
3 | * @brief Interface of the font manager
4 | */
5 |
6 | #pragma once
7 |
8 | enum
9 | {
10 | FDAT_BOLD = 0x01,
11 | FDAT_PROPORTIONAL = 0x02,
12 | FDAT_ALIAS = 0x04,
13 | FDAT_ANSI = 0x08
14 | };
15 |
16 | enum
17 | {
18 | FDAT_DEPTH = 255,
19 | FDAT_DEPTHBIT = 8
20 | };
21 |
22 | typedef struct
23 | {
24 | int width;
25 | int height;
26 | int pitch;
27 | } _FNTDAT, *FNTDAT;
28 |
29 |
30 | #ifdef __cplusplus
31 | extern "C"
32 | {
33 | #endif
34 |
35 | void *fontmng_create(int size, UINT type, const char *fontface);
36 | void fontmng_destroy(void *hdl);
37 |
38 | BRESULT fontmng_getsize(void *hdl, const char *string, POINT_T *pt);
39 | BRESULT fontmng_getdrawsize(void *hdl, const char *string, POINT_T *pt);
40 | FNTDAT fontmng_get(void *hdl, const char *string);
41 |
42 | #ifdef __cplusplus
43 | }
44 | #endif
45 |
46 |
47 |
48 | // ---- for SDL
49 |
50 | BRESULT fontmng_init(void);
51 | void fontmng_setdeffontname(const char *name);
52 |
--------------------------------------------------------------------------------
/sdl2/iOS/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/sdl2/iOS/Default-568h@2x.png
--------------------------------------------------------------------------------
/sdl2/iOS/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/sdl2/iOS/Default-Landscape.png
--------------------------------------------------------------------------------
/sdl2/iOS/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/sdl2/iOS/Default.png
--------------------------------------------------------------------------------
/sdl2/iOS/Icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/sdl2/iOS/Icon-72.png
--------------------------------------------------------------------------------
/sdl2/iOS/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/sdl2/iOS/Icon.png
--------------------------------------------------------------------------------
/sdl2/iOS/compiler.pch:
--------------------------------------------------------------------------------
1 | /**
2 | * @file compiler.pch
3 | * @brief プリコンパイル済みヘッダー
4 | */
5 |
6 | #ifndef np2sdl2_compiler_pch
7 | #define np2sdl2_compiler_pch
8 |
9 | // Include any system framework and library headers here that should be included in all compilation units.
10 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
11 | #include "compiler.h"
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/sdl2/iOS/main.m:
--------------------------------------------------------------------------------
1 | /*
2 | * @file main.m
3 | */
4 |
5 | #import "compiler.h"
6 | #include "../np2.h"
7 | #include "../dosio.h"
8 |
9 | int SDL_main(int argc, char *argv[])
10 | {
11 | NSArray *paths;
12 | NSString *DocumentsDirPath;
13 |
14 | paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
15 | DocumentsDirPath = [paths objectAtIndex:0];
16 |
17 | NSString *current = [DocumentsDirPath stringByAppendingString:@"/"];
18 | file_setcd([current UTF8String]);
19 |
20 | return np2_main(argc, argv);
21 | }
22 |
--------------------------------------------------------------------------------
/sdl2/ini.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | INITYPE_STR = 0,
4 | INITYPE_BOOL,
5 | INITYPE_BYTEARG,
6 | INITYPE_SINT8,
7 | INITYPE_SINT16,
8 | INITYPE_SINT32,
9 | INITYPE_UINT8,
10 | INITYPE_UINT16,
11 | INITYPE_UINT32,
12 | INITYPE_HEX8,
13 | INITYPE_HEX16,
14 | INITYPE_HEX32,
15 | INITYPE_USER
16 | };
17 |
18 | typedef struct {
19 | const char *item;
20 | UINT itemtype;
21 | void *value;
22 | UINT size;
23 | } INITBL;
24 |
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | void ini_read(const char *path, const char *title,
31 | const INITBL *tbl, UINT count);
32 | void ini_write(const char *path, const char *title,
33 | const INITBL *tbl, UINT count);
34 |
35 | void initload(void);
36 | void initsave(void);
37 |
38 | #ifdef __cplusplus
39 | }
40 | #endif
41 |
42 |
--------------------------------------------------------------------------------
/sdl2/inputmng.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | LBUTTON_BIT = (1 << 0),
4 | RBUTTON_BIT = (1 << 1),
5 | LBUTTON_DOWNBIT = (1 << 2),
6 | RBUTTON_DOWNBIT = (1 << 3),
7 | LBUTTON_UPBIT = (1 << 4),
8 | RBUTTON_UPBIT = (1 << 5),
9 | MOUSE_MOVEBIT = (1 << 6),
10 |
11 | KEY_ENTER = 0x01,
12 | KEY_MENU = 0x02,
13 | KEY_SKIP = 0x04,
14 | KEY_EXT = 0x08,
15 | KEY_UP = 0x10,
16 | KEY_DOWN = 0x20,
17 | KEY_LEFT = 0x40,
18 | KEY_RIGHT = 0x80
19 | };
20 |
21 |
22 | #ifdef __cplusplus
23 | extern "C" {
24 | #endif
25 |
26 | void inputmng_init(void);
27 | void inputmng_keybind(short key, UINT bit);
28 | UINT inputmng_getkey(short key);
29 |
30 | #ifdef __cplusplus
31 | }
32 | #endif
33 |
34 |
--------------------------------------------------------------------------------
/sdl2/joymng.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "joymng.h"
3 |
4 |
5 | UINT8 joymng_getstat(void) {
6 |
7 | return(0xff);
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/sdl2/joymng.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | UINT8 joymng_getstat(void);
7 |
8 | #ifdef __cplusplus
9 | }
10 | #endif
11 |
12 |
--------------------------------------------------------------------------------
/sdl2/mousemng.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "mousemng.h"
3 |
4 |
5 | UINT8 mousemng_getstat(SINT16 *x, SINT16 *y, int clear) {
6 |
7 | *x = 0;
8 | *y = 0;
9 | (void)clear;
10 | return(0xa0);
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/sdl2/mousemng.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | UINT8 mousemng_getstat(SINT16 *x, SINT16 *y, int clear);
7 |
8 | #ifdef __cplusplus
9 | }
10 | #endif
11 |
12 |
--------------------------------------------------------------------------------
/sdl2/np2.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | UINT8 NOWAIT;
4 | UINT8 DRAW_SKIP;
5 | UINT8 F12KEY;
6 | UINT8 resume;
7 | UINT8 jastsnd;
8 | } NP2OSCFG;
9 |
10 |
11 | #if defined(SIZE_QVGA)
12 | enum {
13 | FULLSCREEN_WIDTH = 320,
14 | FULLSCREEN_HEIGHT = 240
15 | };
16 | #else
17 | enum {
18 | FULLSCREEN_WIDTH = 640,
19 | FULLSCREEN_HEIGHT = 400
20 | };
21 | #endif
22 |
23 | extern NP2OSCFG np2oscfg;
24 |
25 | extern int np2_main(int argc, char *argv[]);
26 |
--------------------------------------------------------------------------------
/sdl2/oemtext.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file oemtext.h
3 | * @breif defines converter
4 | */
5 |
6 | #pragma once
7 |
8 | #include "codecnv/codecnv.h"
9 |
10 | #define oemtext_oemtosjis(a, b, c, d) codecnv_utf8tosjis(a, b, c, d)
11 | #define oemtext_sjistooem(a, b, c, d) codecnv_sjistoutf8(a, b, c, d)
12 |
--------------------------------------------------------------------------------
/sdl2/scrnmng.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | UINT8 *ptr;
4 | int xalign;
5 | int yalign;
6 | int width;
7 | int height;
8 | UINT bpp;
9 | int extend;
10 | } SCRNSURF;
11 |
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif
16 |
17 | void scrnmng_setwidth(int posx, int width);
18 | #define scrnmng_setextend(e)
19 | void scrnmng_setheight(int posy, int height);
20 | const SCRNSURF *scrnmng_surflock(void);
21 | void scrnmng_surfunlock(const SCRNSURF *surf);
22 |
23 | #define scrnmng_isfullscreen() (0)
24 | #define scrnmng_haveextend() (0)
25 | #define scrnmng_getbpp() (16)
26 | #define scrnmng_allflash()
27 | #define scrnmng_palchanged()
28 |
29 | RGB16 scrnmng_makepal16(RGB32 pal32);
30 |
31 | #ifdef __cplusplus
32 | }
33 | #endif
34 |
35 |
36 | // ---- for SDL
37 |
38 | void scrnmng_initialize(void);
39 | BRESULT scrnmng_create(int width, int height);
40 | void scrnmng_destroy(void);
41 |
42 |
43 | // ---- for menubase
44 |
45 | typedef struct {
46 | int width;
47 | int height;
48 | int bpp;
49 | } SCRNMENU;
50 |
51 | BRESULT scrnmng_entermenu(SCRNMENU *smenu);
52 | void scrnmng_leavemenu(void);
53 | void scrnmng_menudraw(const RECT_T *rct);
54 |
55 |
--------------------------------------------------------------------------------
/sdl2/sdlkbd.h:
--------------------------------------------------------------------------------
1 |
2 | void sdlkbd_initialize(void);
3 | void sdlkbd_keydown(UINT key);
4 | void sdlkbd_keyup(UINT key);
5 | void sdlkbd_resetf12(void);
6 |
7 |
--------------------------------------------------------------------------------
/sdl2/soundmng.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | SOUND_PCMSEEK = 0,
4 | SOUND_PCMSEEK1 = 1,
5 |
6 | SOUND_MAXPCM
7 | };
8 |
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | UINT soundmng_create(UINT rate, UINT ms);
15 | void soundmng_destroy(void);
16 | #define soundmng_reset()
17 | void soundmng_play(void);
18 | void soundmng_stop(void);
19 | #define soundmng_sync()
20 | #define soundmng_setreverse(r)
21 |
22 | #define soundmng_pcmplay(a, b)
23 | #define soundmng_pcmstop(a)
24 |
25 |
26 |
27 | // ---- for SDL
28 |
29 | void soundmng_initialize(void);
30 | void soundmng_deinitialize(void);
31 |
32 | #ifdef __cplusplus
33 | }
34 | #endif
35 |
--------------------------------------------------------------------------------
/sdl2/sysmenu.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | MENUTYPE_NORMAL = 0
4 | };
5 |
6 |
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 |
11 | BRESULT sysmenu_create(void);
12 | void sysmenu_destroy(void);
13 |
14 | BRESULT sysmenu_menuopen(UINT menutype, int x, int y);
15 |
16 | #ifdef __cplusplus
17 | }
18 | #endif
19 |
20 |
--------------------------------------------------------------------------------
/sdl2/sysmng.c:
--------------------------------------------------------------------------------
1 | /**
2 | * @file sysmng.c
3 | * @brief Implementation of the system
4 | */
5 |
6 | #include "compiler.h"
7 | #include "sysmng.h"
8 | #include "ini.h"
9 |
10 | /**
11 | * Initialize
12 | */
13 | void sysmng_initialize(void)
14 | {
15 | }
16 |
17 | /**
18 | * Deinitialize
19 | */
20 | void sysmng_deinitialize(void)
21 | {
22 | }
23 |
24 | /**
25 | * Notifies flags
26 | * @param[in] update update flags
27 | */
28 | void sysmng_update(UINT update)
29 | {
30 | if (update & (SYS_UPDATECFG | SYS_UPDATEOSCFG))
31 | {
32 | initsave();
33 | }
34 | }
35 |
36 | /**
37 | * Notifies CPU Reset
38 | */
39 | void sysmng_cpureset(void)
40 | {
41 | }
42 |
--------------------------------------------------------------------------------
/sdl2/sysmng.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file sysmng.h
3 | * @brief Interface of the system
4 | */
5 |
6 | #pragma once
7 |
8 | // どーでもいい通知系
9 |
10 | enum {
11 | SYS_UPDATECFG = 0x0001,
12 | SYS_UPDATEOSCFG = 0x0002,
13 | SYS_UPDATECLOCK = 0x0004,
14 | SYS_UPDATERATE = 0x0008,
15 | SYS_UPDATESBUF = 0x0010,
16 | SYS_UPDATEMIDI = 0x0020,
17 | SYS_UPDATESBOARD = 0x0040,
18 | SYS_UPDATEFDD = 0x0080,
19 | SYS_UPDATEHDD = 0x0100,
20 | SYS_UPDATEMEMORY = 0x0200,
21 | SYS_UPDATESERIAL1 = 0x0400
22 | };
23 |
24 | void sysmng_initialize(void);
25 | void sysmng_deinitialize(void);
26 |
27 | #ifdef __cplusplus
28 | extern "C" {
29 | #endif
30 |
31 | void sysmng_update(UINT update);
32 | void sysmng_cpureset(void);
33 | #define sysmng_fddaccess(a)
34 | #define sysmng_hddaccess(a)
35 |
36 | #ifdef __cplusplus
37 | }
38 | #endif
39 |
40 |
--------------------------------------------------------------------------------
/sdl2/taskmng.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | extern BOOL task_avail;
7 |
8 | void taskmng_initialize(void);
9 | void taskmng_exit(void);
10 | void taskmng_rol(void);
11 | #define taskmng_isavail() (task_avail)
12 | BOOL taskmng_sleep(UINT32 tick);
13 |
14 | #ifdef __cplusplus
15 | }
16 | #endif
17 |
18 |
--------------------------------------------------------------------------------
/sdl2/timemng.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include
3 | #include "timemng.h"
4 |
5 |
6 | BRESULT timemng_gettime(_SYSTIME *systime) {
7 |
8 | time_t long_time;
9 | struct tm *now_time;
10 |
11 | time(&long_time);
12 | now_time = localtime(&long_time);
13 | if (now_time != NULL) {
14 | systime->year = now_time->tm_year + 1900;
15 | systime->month = now_time->tm_mon + 1;
16 | systime->week = now_time->tm_wday;
17 | systime->day = now_time->tm_mday;
18 | systime->hour = now_time->tm_hour;
19 | systime->minute = now_time->tm_min;
20 | systime->second = now_time->tm_sec;
21 | systime->milli = 0;
22 | return(SUCCESS);
23 | }
24 | else {
25 | return(FAILURE);
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/sdl2/timemng.h:
--------------------------------------------------------------------------------
1 |
2 | // Win32 SYSTEMTIME ストラクチャ
3 |
4 | typedef struct {
5 | UINT16 year;
6 | UINT16 month;
7 | UINT16 week;
8 | UINT16 day;
9 | UINT16 hour;
10 | UINT16 minute;
11 | UINT16 second;
12 | UINT16 milli;
13 | } _SYSTIME;
14 |
15 |
16 | #ifdef __cplusplus
17 | extern "C" {
18 | #endif
19 |
20 | BRESULT timemng_gettime(_SYSTIME *systime);
21 |
22 | #ifdef __cplusplus
23 | }
24 | #endif
25 |
26 |
--------------------------------------------------------------------------------
/sdl2/trace.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include
3 | #if defined(WIN32) && defined(OSLANG_EUC)
4 | #include "codecnv/codecnv.h"
5 | #endif
6 |
7 | #ifdef TRACE
8 | void trace_init(void) {
9 | }
10 |
11 | void trace_term(void) {
12 | }
13 |
14 | void trace_fmt(const char *fmt, ...) {
15 |
16 | va_list ap;
17 | char buf[1024];
18 | #if defined(WIN32) && defined(OSLANG_EUC)
19 | char sjis[1024];
20 | #endif
21 |
22 | va_start(ap, fmt);
23 | vsprintf(buf, fmt, ap);
24 | va_end(ap);
25 | #if defined(WIN32) && defined(OSLANG_EUC)
26 | codecnv_euctosjis(sjis, NELEMENTS(sjis), buf, (UINT)-1);
27 | printf("%s\n", sjis);
28 | #else
29 | printf("%s\n", buf);
30 | #endif
31 | }
32 | #endif
33 |
34 |
--------------------------------------------------------------------------------
/sdl2/trace.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef TRACE
3 |
4 | #define TRACEINIT()
5 | #define TRACETERM()
6 | #define TRACEOUT(a)
7 | #define VERBOSE(a)
8 |
9 | #else
10 |
11 | #ifdef __cplusplus
12 | extern "C" {
13 | #endif
14 |
15 | void trace_init(void);
16 | void trace_term(void);
17 | void trace_fmt(const char *str, ...);
18 |
19 | #define TRACEINIT() trace_init()
20 | #define TRACETERM() trace_term()
21 | #define TRACEOUT(arg) trace_fmt arg
22 | #define VERBOSE(arg) trace_fmt arg
23 |
24 | #ifdef __cplusplus
25 | };
26 | #endif
27 |
28 | #endif
29 |
30 |
--------------------------------------------------------------------------------
/sdl2/win32/compiler.c:
--------------------------------------------------------------------------------
1 | // compiler.cpp : 標準インクルード np2sdl2.pch のみを
2 | // 含むソース ファイルは、プリコンパイル済みヘッダーになります。
3 | // compiler.obj にはプリコンパイル済み型情報が含まれます。
4 |
5 | #include "compiler.h"
6 |
7 | // TODO: このファイルではなく、compiler.h で必要な
8 | // 追加ヘッダーを参照してください。
9 |
--------------------------------------------------------------------------------
/sdl2/win32/main.c:
--------------------------------------------------------------------------------
1 | /**
2 | * @file main.c
3 | * @brief メイン
4 | */
5 |
6 | #include "compiler.h"
7 | #include "np2.h"
8 | #include "..\fontmng.h"
9 |
10 | #pragma comment(lib, "SDL2.lib")
11 | #pragma comment(lib, "SDL2main.lib")
12 |
13 | #if !defined(RESOURCE_US)
14 | #pragma comment(lib, "SDL2_ttf.lib")
15 | #endif
16 |
17 | /**
18 | * メイン
19 | * @param[in] argc 引数
20 | * @param[in] argv 引数
21 | * @return リザルト コード
22 | */
23 | int main(int argc, char *argv[])
24 | {
25 | UINT nLength;
26 | TCHAR szFont[MAX_PATH];
27 |
28 | nLength = GetWindowsDirectory(szFont, SDL_arraysize(szFont));
29 | lstrcpy(szFont + nLength, TEXT("\\Fonts\\msgothic.ttc"));
30 | fontmng_setdeffontname(szFont);
31 |
32 | return np2_main(argc, argv);
33 | }
34 |
--------------------------------------------------------------------------------
/sdl2/win32/misc/guard.h:
--------------------------------------------------------------------------------
1 | /*!
2 | * @file guard.h
3 | * @brief クリティカル セクション クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | /*!
9 | * @brief クリティカル セクション クラス
10 | */
11 | class CGuard
12 | {
13 | public:
14 | /*! コンストラクタ */
15 | CGuard() { ::InitializeCriticalSection(&m_cs); }
16 |
17 | /*! デストラクタ */
18 | ~CGuard() { ::DeleteCriticalSection(&m_cs); }
19 |
20 | /*! クリティカル セクション開始 */
21 | void Enter() { ::EnterCriticalSection(&m_cs); }
22 |
23 | /*! クリティカル セクション終了 */
24 | void Leave() { ::LeaveCriticalSection(&m_cs); }
25 |
26 | private:
27 | CRITICAL_SECTION m_cs; //!< クリティカル セクション情報
28 | };
29 |
--------------------------------------------------------------------------------
/sdl2/win32/misc/threadbase.h:
--------------------------------------------------------------------------------
1 | /*!
2 | * @file threadbase.h
3 | * @brief スレッド基底クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | /*!
9 | * @brief スレッド基底クラス
10 | */
11 | class CThreadBase
12 | {
13 | public:
14 | CThreadBase();
15 | virtual ~CThreadBase();
16 |
17 | bool Start();
18 | void Stop();
19 | bool Restart();
20 | void SetStackSize(size_t nStackSize);
21 | static void Delay(unsigned int usec);
22 |
23 | protected:
24 | virtual bool Task() = 0; //!< スレッド タスク
25 |
26 | private:
27 | HANDLE m_hThread; //!< スレッド ハンドル
28 | DWORD m_dwThreadId; //!< スレッド ID
29 | bool m_bAbort; //!< 中断フラグ
30 | bool m_bDone; //!< 完了フラグ
31 | size_t m_nStackSize; //!< スタック サイズ
32 | static unsigned __stdcall ThreadProc(LPVOID pParam);
33 | };
34 |
35 | /**
36 | * スタック サイズの設定
37 | * @param[in] nStackSize スタック サイズ
38 | */
39 | inline void CThreadBase::SetStackSize(size_t nStackSize)
40 | {
41 | m_nStackSize = nStackSize;
42 | }
43 |
44 | /**
45 | * スリープ
46 | * @param[in] usec マイクロ秒
47 | */
48 | inline void CThreadBase::Delay(unsigned int usec)
49 | {
50 | ::Sleep((usec + 999) / 1000);
51 | }
52 |
--------------------------------------------------------------------------------
/sdl2/win32/misc/tty.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file tty.h
3 | * @brief シリアル通信クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | /**
9 | * @brief シリアル通信
10 | */
11 | class CTty
12 | {
13 | public:
14 | CTty();
15 | ~CTty();
16 | bool Open(LPCTSTR lpDevName, UINT nSpeed = 0, LPCTSTR lpcszParam = NULL);
17 | bool IsOpened() const;
18 | void Close();
19 | int Read(LPVOID lpcvData, int nDataSize);
20 | int Write(LPCVOID lpcvData, int nDataSize);
21 |
22 | private:
23 | HANDLE m_hFile; /*!< ファイル ハンドル */
24 | bool OpenPort(LPCTSTR lpPortName, UINT nSpeed, LPCTSTR lpcszParam);
25 | static bool SetParam(LPCTSTR lpcszParam, DCB* dcb = NULL);
26 | };
27 |
28 | /**
29 | * オープン済?
30 | * @retval true オープン済
31 | * @retval false 未オープン
32 | */
33 | inline bool CTty::IsOpened() const
34 | {
35 | return (m_hFile != INVALID_HANDLE_VALUE);
36 | }
37 |
--------------------------------------------------------------------------------
/sdl2/win32/misc/usbdev.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file usbdev.h
3 | * @brief USB アクセス クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | #undef NTDDI_VERSION
9 | #define NTDDI_VERSION NTDDI_WINXP
10 | #include
11 |
12 | /**
13 | * @brief USB アクセス クラス
14 | */
15 | class CUsbDev
16 | {
17 | public:
18 | CUsbDev();
19 | ~CUsbDev();
20 | bool Open(unsigned int vid, unsigned int pid);
21 | void Close();
22 | int CtrlXfer(int nType, int nRequest, int nValue = 0, int nIndex = 0, void* lpBuffer = NULL, int cbBuffer = 0);
23 | int WriteBulk(const void* lpBuffer, int cbBuffer);
24 | int ReadBulk(void* lpBuffer, int cbBuffer);
25 | bool IsOpened() const;
26 |
27 | private:
28 | HANDLE m_hDev; /*!< デバイス ハンドル */
29 | WINUSB_INTERFACE_HANDLE m_hWinUsb; /*!< WinUSB */
30 | UCHAR m_cOutPipeId; /*!< パイプ ID */
31 | UCHAR m_cInPipeId; /*!< パイプ id */
32 | static LPTSTR GetDevicePath(const GUID& InterfaceGuid, LPTSTR lpDevicePath, int cchDevicePath);
33 | bool Open(const GUID& InterfaceGuid);
34 | bool OpenDevice(LPCTSTR lpDevicePath);
35 | };
36 |
37 | /**
38 | * オープン済?
39 | * @retval true オープン済
40 | * @retval false 未オープン
41 | */
42 | inline bool CUsbDev::IsOpened() const
43 | {
44 | return (m_hDev != INVALID_HANDLE_VALUE);
45 | }
46 |
--------------------------------------------------------------------------------
/sound/fmboard.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file fmboard.h
3 | */
4 |
5 | #pragma once
6 |
7 | #if !defined(DISABLE_SOUND)
8 |
9 | #include "fmtimer.h"
10 | #include "opna.h"
11 | #include "pcm86.h"
12 | #include "cs4231.h"
13 |
14 | #ifdef __cplusplus
15 | extern "C"
16 | {
17 | #endif
18 |
19 | #if defined(SUPPORT_PX)
20 | #define OPNA_MAX 5
21 | #else /* defined(SUPPORT_PX) */
22 | #define OPNA_MAX 2
23 | #endif /* defined(SUPPORT_PX) */
24 |
25 | extern UINT32 g_usesound;
26 | extern _OPNA g_opna[OPNA_MAX];
27 | extern _FMTIMER g_fmtimer;
28 | extern _PCM86 pcm86;
29 | extern _CS4231 cs4231;
30 |
31 | REG8 fmboard_getjoy(POPNA opna);
32 |
33 | void fmboard_extreg(void (*ext)(REG8 enable));
34 | void fmboard_extenable(REG8 enable);
35 |
36 | void fmboard_construct(void);
37 | void fmboard_destruct(void);
38 | void fmboard_reset(const NP2CFG *pConfig, UINT32 type);
39 | void fmboard_bind(void);
40 |
41 | #ifdef __cplusplus
42 | }
43 | #endif
44 |
45 | #else
46 |
47 | #define fmboard_reset(c, t)
48 | #define fmboard_bind()
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/sound/fmtimer.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | UINT16 timera;
4 | UINT8 timerb;
5 | UINT8 status;
6 | UINT8 reg;
7 | UINT8 intr;
8 | UINT8 irq;
9 | UINT8 intdisabel;
10 | } _FMTIMER, *FMTIMER;
11 |
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif
16 |
17 | void fmport_a(NEVENTITEM item);
18 | void fmport_b(NEVENTITEM item);
19 |
20 | void fmtimer_reset(UINT irq);
21 | void fmtimer_setreg(UINT reg, REG8 value);
22 |
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 |
27 |
--------------------------------------------------------------------------------
/sound/pcmmix.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file pcmmix.h
3 | * @brief Interface of the pcm sound
4 | */
5 |
6 | #pragma once
7 |
8 | #include "sound.h"
9 |
10 | enum {
11 | PMIXFLAG_L = 0x0001,
12 | PMIXFLAG_R = 0x0002,
13 | PMIXFLAG_LOOP = 0x0004
14 | };
15 |
16 | typedef struct {
17 | UINT32 playing;
18 | UINT32 enable;
19 | } PMIXHDR;
20 |
21 | typedef struct {
22 | SINT16 *sample;
23 | UINT samples;
24 | } PMIXDAT;
25 |
26 | typedef struct {
27 | const SINT16 *pcm;
28 | UINT remain;
29 | PMIXDAT data;
30 | UINT flag;
31 | SINT32 volume;
32 | } PMIXTRK;
33 |
34 | typedef struct {
35 | PMIXHDR hdr;
36 | PMIXTRK trk[1];
37 | } _PCMMIX, *PCMMIX;
38 |
39 |
40 | #ifdef __cplusplus
41 | extern "C"
42 | {
43 | #endif
44 |
45 | BRESULT pcmmix_regist(PMIXDAT *dat, void *datptr, UINT datsize, UINT rate);
46 | BRESULT pcmmix_regfile(PMIXDAT *dat, const OEMCHAR *fname, UINT rate);
47 |
48 | void SOUNDCALL pcmmix_getpcm(PCMMIX hdl, SINT32 *pcm, UINT count);
49 |
50 | #ifdef __cplusplus
51 | }
52 | #endif
53 |
--------------------------------------------------------------------------------
/sound/rhythm.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file rhythm.h
3 | * @brief Interface of the OPNA rhythm
4 | */
5 |
6 | #pragma once
7 |
8 | #include "pcmmix.h"
9 |
10 | typedef struct {
11 | PMIXHDR hdr;
12 | PMIXTRK trk[6];
13 | UINT vol;
14 | UINT8 trkvol[8];
15 | } _RHYTHM, *RHYTHM;
16 |
17 |
18 | #ifdef __cplusplus
19 | extern "C" {
20 | #endif
21 |
22 | void rhythm_initialize(UINT rate);
23 | void rhythm_deinitialize(void);
24 | UINT rhythm_getcaps(void);
25 | void rhythm_setvol(UINT vol);
26 |
27 | void rhythm_reset(RHYTHM rhy);
28 | void rhythm_bind(RHYTHM rhy);
29 | void rhythm_update(RHYTHM rhy);
30 | void rhythm_setreg(RHYTHM rhy, UINT reg, REG8 val);
31 |
32 | #ifdef __cplusplus
33 | }
34 | #endif
35 |
--------------------------------------------------------------------------------
/sound/s98.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file s98.h
3 | * @brief Interface of logging PC-98 sound
4 | */
5 |
6 | #pragma once
7 |
8 | enum {
9 | NORMAL2608 = 0,
10 | EXTEND2608 = 1
11 | };
12 |
13 |
14 | #ifdef __cplusplus
15 | extern "C" {
16 | #endif
17 |
18 | #if !defined(SUPPORT_S98) // コールすら面倒だ!
19 |
20 | #define S98_init()
21 | #define S98_trash()
22 | #define S98_open(f) (FAILURE)
23 | #define S98_close()
24 | #define S98_put(m, a, d)
25 | #define S98_sync()
26 |
27 | #else
28 |
29 | void S98_init(void);
30 | void S98_trash(void);
31 | BRESULT S98_open(const OEMCHAR *filename);
32 | void S98_close(void);
33 | void S98_put(REG8 module, UINT addr, REG8 data);
34 | void S98_sync(void);
35 |
36 | #endif
37 |
38 | #ifdef __cplusplus
39 | }
40 | #endif
41 |
--------------------------------------------------------------------------------
/sound/sndcsec.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "sound.h"
3 | #include "sndcsec.h"
4 |
5 |
6 | #if defined(SOUND_CRITICAL)
7 |
8 | #if defined(WIN32) || defined(_WIN32_WCE)
9 |
10 | CRITICAL_SECTION sndcsec;
11 |
12 | #elif defined(MACOS)
13 |
14 | MPCriticalRegionID sndcsec;
15 |
16 | #elif defined(X11)
17 |
18 | pthread_mutex_t sndcsec; // = PTHREAD_MUTEX_INITIALIZER;
19 |
20 | #elif defined(_SDL_mutex_h)
21 |
22 | SDL_mutex* g_sndcsec;
23 |
24 | #endif
25 |
26 | #endif
27 |
28 |
--------------------------------------------------------------------------------
/sound/sound.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file sound.h
3 | * @brief Interface of the sound
4 | */
5 |
6 | #pragma once
7 |
8 | #ifndef SOUNDCALL
9 | #define SOUNDCALL
10 | #endif
11 |
12 | #if !defined(DISABLE_SOUND)
13 |
14 | typedef void (SOUNDCALL * SOUNDCB)(void *hdl, SINT32 *pcm, UINT count);
15 |
16 | typedef struct {
17 | UINT rate;
18 | UINT32 hzbase;
19 | UINT32 clockbase;
20 | UINT32 minclock;
21 | UINT32 lastclock;
22 | UINT writecount;
23 | } SOUNDCFG;
24 |
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | extern SOUNDCFG soundcfg;
31 |
32 | BRESULT sound_create(UINT rate, UINT ms);
33 | void sound_destroy(void);
34 |
35 | void sound_reset(void);
36 | void sound_changeclock(void);
37 | void sound_streamregist(void *hdl, SOUNDCB cbfn);
38 |
39 | void sound_sync(void);
40 |
41 | const SINT32 *sound_pcmlock(void);
42 | void sound_pcmunlock(const SINT32 *hdl);
43 |
44 | #if defined(SUPPORT_WAVEREC)
45 | BRESULT sound_recstart(const OEMCHAR *filename);
46 | void sound_recstop(void);
47 | #endif
48 |
49 | #ifdef __cplusplus
50 | }
51 | #endif
52 |
53 | #else
54 |
55 | #define sound_pcmlock() (NULL)
56 | #define sound_pcmunlock(h)
57 | #define sound_reset()
58 | #define sound_changeclock()
59 | #define sound_sync()
60 |
61 | #endif
62 |
63 |
--------------------------------------------------------------------------------
/sound/soundrom.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file soundrom.h
3 | * @brief Interface of the sound rom
4 | */
5 |
6 | #pragma once
7 |
8 | typedef struct {
9 | OEMCHAR name[24];
10 | UINT32 address;
11 | } SOUNDROM;
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif
16 |
17 | extern SOUNDROM soundrom;
18 |
19 | void soundrom_reset(void);
20 | void soundrom_load(UINT32 address, const OEMCHAR *primary);
21 | void soundrom_loadex(UINT sw, const OEMCHAR *primary);
22 |
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 |
--------------------------------------------------------------------------------
/sound/tms3631.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | UINT32 freq;
4 | UINT32 count;
5 | } TMSCH;
6 |
7 | typedef struct {
8 | TMSCH ch[8];
9 | UINT enable;
10 | } _TMS3631, *TMS3631;
11 |
12 | typedef struct {
13 | UINT ratesft;
14 | SINT32 left;
15 | SINT32 right;
16 | SINT32 feet[16];
17 | } TMS3631CFG;
18 |
19 |
20 | #ifdef __cplusplus
21 | extern "C" {
22 | #endif
23 |
24 | void tms3631_initialize(UINT rate);
25 | void tms3631_setvol(const UINT8 *vol);
26 |
27 | void tms3631_reset(TMS3631 tms);
28 | void tms3631_setkey(TMS3631 tms, REG8 ch, REG8 key);
29 | void tms3631_setenable(TMS3631 tms, REG8 enable);
30 |
31 | void SOUNDCALL tms3631_getpcm(TMS3631 tms, SINT32 *pcm, UINT count);
32 |
33 | #ifdef __cplusplus
34 | }
35 | #endif
36 |
37 |
--------------------------------------------------------------------------------
/sound/vermouth/midimod.h:
--------------------------------------------------------------------------------
1 |
2 | struct _pathlist;
3 | typedef struct _pathlist _PATHLIST;
4 | typedef struct _pathlist *PATHLIST;
5 |
6 | struct _pathlist {
7 | PATHLIST next;
8 | OEMCHAR path[MAX_PATH];
9 | };
10 |
11 | enum {
12 | TONECFG_EXIST = 0x01,
13 | TONECFG_NOLOOP = 0x02,
14 | TONECFG_NOENV = 0x04,
15 | TONECFG_KEEPENV = 0x08,
16 | TONECFG_NOTAIL = 0x10,
17 |
18 | TONECFG_AUTOAMP = -1,
19 | TONECFG_VARIABLE = 0xff
20 | };
21 |
22 | typedef struct {
23 | OEMCHAR *name;
24 | int amp;
25 | UINT8 flag;
26 | UINT8 pan;
27 | UINT8 note;
28 | } _TONECFG, *TONECFG;
29 |
30 |
31 | #ifdef __cplusplus
32 | extern "C" {
33 | #endif
34 |
35 | BRESULT VERMOUTHCL midimod_getfile(MIDIMOD mod, const OEMCHAR *filename,
36 | OEMCHAR *path, int size);
37 | void VERMOUTHCL midimod_lock(MIDIMOD mod);
38 | void VERMOUTHCL midimod_unlock(MIDIMOD mod);
39 |
40 | #ifdef __cplusplus
41 | }
42 | #endif
43 |
44 |
--------------------------------------------------------------------------------
/statsave.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file statsave.h
3 | * @brief Interface of state save
4 | */
5 |
6 | #pragma once
7 |
8 | /**
9 | * Result code
10 | */
11 | enum
12 | {
13 | STATFLAG_SUCCESS = 0,
14 | STATFLAG_DISKCHG = 0x0001,
15 | STATFLAG_VERCHG = 0x0002,
16 | STATFLAG_WARNING = 0x0080,
17 | STATFLAG_VERSION = 0x0100,
18 | STATFLAG_FAILURE = -1
19 | };
20 |
21 | struct TagStatFlagHandle;
22 | typedef struct TagStatFlagHandle *STFLAGH;
23 |
24 | /**
25 | * @brief The entry of state flag
26 | */
27 | struct TagStatFlagEntry
28 | {
29 | char index[12];
30 | UINT16 ver;
31 | UINT16 type;
32 | void *arg1;
33 | UINT arg2;
34 | };
35 | typedef struct TagStatFlagEntry SFENTRY;
36 |
37 | #ifdef __cplusplus
38 | extern "C"
39 | {
40 | #endif
41 |
42 | int statflag_read(STFLAGH sfh, void *ptr, UINT size);
43 | int statflag_write(STFLAGH sfh, const void *ptr, UINT size);
44 | void statflag_seterr(STFLAGH sfh, const OEMCHAR *str);
45 |
46 | int statsave_save(const OEMCHAR *filename);
47 | int statsave_check(const OEMCHAR *filename, OEMCHAR *buf, int size);
48 | int statsave_load(const OEMCHAR *filename);
49 |
50 | #ifdef __cplusplus
51 | }
52 | #endif
53 |
--------------------------------------------------------------------------------
/timing.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "pccore.h"
3 | #include "fdd/diskdrv.h"
4 | #include "fdd/fdd_mtr.h"
5 | #include "timing.h"
6 |
7 |
8 | #define MSSHIFT 16
9 |
10 | typedef struct {
11 | UINT32 tick;
12 | UINT32 msstep;
13 | UINT cnt;
14 | UINT32 fraction;
15 | } TIMING;
16 |
17 | static TIMING timing;
18 |
19 |
20 | void timing_reset(void) {
21 |
22 | timing.tick = GETTICK();
23 | timing.cnt = 0;
24 | timing.fraction = 0;
25 | }
26 |
27 | void timing_setrate(UINT lines, UINT crthz) {
28 |
29 | timing.msstep = (crthz << (MSSHIFT - 3)) / lines / (1000 >> 3);
30 | }
31 |
32 | void timing_setcount(UINT value) {
33 |
34 | timing.cnt = value;
35 | }
36 |
37 | UINT timing_getcount(void) {
38 |
39 | UINT32 ticknow;
40 | UINT32 span;
41 | UINT32 fraction;
42 |
43 | ticknow = GETTICK();
44 | span = ticknow - timing.tick;
45 | if (span) {
46 | timing.tick = ticknow;
47 | fddmtr_callback(ticknow);
48 |
49 | if (span >= 1000) {
50 | span = 1000;
51 | }
52 | fraction = timing.fraction + (span * timing.msstep);
53 | timing.cnt += fraction >> MSSHIFT;
54 | timing.fraction = fraction & ((1 << MSSHIFT) - 1);
55 | }
56 | return(timing.cnt);
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/timing.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void timing_reset(void);
7 | void timing_setrate(UINT lines, UINT crthz);
8 | void timing_setcount(UINT value);
9 | UINT timing_getcount(void);
10 |
11 | #ifdef __cplusplus
12 | }
13 | #endif
14 |
15 |
--------------------------------------------------------------------------------
/trap/inttrap.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file inttrap.h
3 | * @brief Interface of the trap of interrupt
4 | */
5 |
6 | #pragma once
7 |
8 | #if defined(ENABLE_TRAP)
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | void CPUCALL softinttrap(UINT cs, UINT32 eip, UINT vect);
15 |
16 | #ifdef __cplusplus
17 | }
18 | #endif
19 |
20 | #endif
21 |
22 |
--------------------------------------------------------------------------------
/trap/steptrap.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file steptrap.h
3 | * @brief Interface of the step trap
4 | */
5 |
6 | #pragma once
7 |
8 | #if defined(ENABLE_TRAP)
9 |
10 | #ifdef __cplusplus
11 | extern "C" {
12 | #endif
13 |
14 | void steptrap_hisfileout(void);
15 |
16 | void CPUCALL steptrap(UINT cs, UINT32 eip);
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/vram/dispsync.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | UINT text_vbp;
4 | UINT textymax;
5 | UINT grph_vbp;
6 | UINT grphymax;
7 |
8 | UINT scrnxpos;
9 | UINT scrnxmax;
10 | UINT scrnxextend;
11 | UINT scrnymax;
12 | UINT32 textvad;
13 | UINT32 grphvad;
14 | } DSYNC;
15 |
16 |
17 | #ifdef __cplusplus
18 | extern "C" {
19 | #endif
20 |
21 | extern DSYNC dsync;
22 |
23 | void dispsync_initialize(void);
24 | BOOL dispsync_renewalmode(void);
25 | BOOL dispsync_renewalhorizontal(void);
26 | BOOL dispsync_renewalvertical(void);
27 |
28 | #ifdef __cplusplus
29 | }
30 | #endif
31 |
32 |
--------------------------------------------------------------------------------
/vram/makegrex.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(SUPPORT_PC9821)
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | void VRAMCALL makegrphex(int page, int alldraw);
9 |
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 |
14 | #endif
15 |
16 |
--------------------------------------------------------------------------------
/vram/makegrph.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | GRPHXMAX = 80,
4 | GRPHYMAX = 400
5 | };
6 |
7 |
8 | #ifdef __cplusplus
9 | extern "C" {
10 | #endif
11 |
12 | void makegrph_initialize(void);
13 | void VRAMCALL makegrph(int page, int alldraw);
14 |
15 | #ifdef __cplusplus
16 | }
17 | #endif
18 |
19 |
--------------------------------------------------------------------------------
/vram/maketext.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | TEXTXMAX = 80,
4 | TEXTYMAX = 400,
5 |
6 | TXTATR_ST = 0x01, // ~シークレット
7 | TXTATR_BL = 0x02, // ブリンク
8 | TXTATR_RV = 0x04, // リバース
9 | TXTATR_UL = 0x08, // アンダーライン
10 | TXTATR_VL = 0x10, // バーチカルライン
11 | TXTATR_BG = 0x10, // 簡易グラフ
12 | TEXTATR_RGB = 0xe0 // ビット並びはGRBの順
13 | };
14 |
15 | typedef struct {
16 | UINT8 timing;
17 | UINT8 count;
18 | UINT8 renewal;
19 | UINT8 gaiji;
20 | UINT8 attr;
21 | UINT8 curdisp;
22 | UINT8 curdisplast;
23 | UINT8 blink;
24 | UINT8 blinkdisp;
25 | UINT16 curpos;
26 | } TRAM_T;
27 |
28 |
29 | #ifdef __cplusplus
30 | extern "C" {
31 | #endif
32 |
33 | extern TRAM_T tramflag;
34 |
35 | void maketext_initialize(void);
36 | void maketext_reset(void);
37 | UINT8 maketext_curblink(void);
38 | void maketext(int text_renewal);
39 | void maketext40(int text_renewal);
40 |
41 | #ifdef __cplusplus
42 | }
43 | #endif
44 |
45 |
--------------------------------------------------------------------------------
/vram/maketgrp.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void maketextgrph(int plane, int text_renewal, int grph_renewal);
7 | void maketextgrph40(int plane, int text_renewal, int grph_renewal);
8 |
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/vram/scrndraw.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef SCRNCALL
3 | #define SCRNCALL
4 | #endif
5 |
6 | enum {
7 | SURFACE_WIDTH = 640,
8 | SURFACE_HEIGHT = 480,
9 | SURFACE_SIZE = (SURFACE_WIDTH * SURFACE_HEIGHT),
10 |
11 | START_PALORG = 0x0a,
12 | START_PAL = 0x10
13 | };
14 |
15 |
16 | #ifdef __cplusplus
17 | extern "C" {
18 | #endif
19 |
20 | extern UINT8 renewal_line[SURFACE_HEIGHT];
21 | extern UINT8 np2_tram[SURFACE_SIZE];
22 | extern UINT8 np2_vram[2][SURFACE_SIZE];
23 |
24 | void scrndraw_initialize(void);
25 | void scrndraw_changepalette(void);
26 | UINT8 scrndraw_draw(UINT8 update);
27 | void scrndraw_redraw(void);
28 |
29 | #ifdef __cplusplus
30 | }
31 | #endif
32 |
33 |
--------------------------------------------------------------------------------
/vram/scrnsave.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file scrnsave.h
3 | * @brief Interface of the screen saver
4 | */
5 |
6 | #pragma once
7 |
8 | /**
9 | * types
10 | */
11 | enum tagScrnSaveType
12 | {
13 | SCRNSAVE_1BIT = 0,
14 | SCRNSAVE_4BIT = 1,
15 | SCRNSAVE_8BIT = 2,
16 | SCRNSAVE_24BIT = 3
17 | };
18 |
19 | /**
20 | * flags
21 | */
22 | enum tagScrnSaveFlags
23 | {
24 | SCRNSAVE_AUTO = 0
25 | };
26 |
27 | struct tagScrnSave;
28 | typedef struct tagScrnSave * SCRNSAVE;
29 |
30 |
31 | #ifdef __cplusplus
32 | extern "C"
33 | {
34 | #endif
35 |
36 | SCRNSAVE scrnsave_create(void);
37 | void scrnsave_destroy(SCRNSAVE hdl);
38 | int scrnsave_gettype(SCRNSAVE hdl);
39 | BRESULT scrnsave_writebmp(SCRNSAVE hdl, const OEMCHAR *filename, UINT flag);
40 | BRESULT scrnsave_writegif(SCRNSAVE hdl, const OEMCHAR *filename, UINT flag);
41 |
42 | #ifdef __cplusplus
43 | }
44 | #endif
45 |
--------------------------------------------------------------------------------
/vram/sdraw.h:
--------------------------------------------------------------------------------
1 |
2 | typedef struct {
3 | const UINT8 *src;
4 | const UINT8 *src2;
5 | UINT8 *dst;
6 | int width;
7 | int xbytes;
8 | int y;
9 | int xalign;
10 | int yalign;
11 | UINT8 dirty[SURFACE_HEIGHT];
12 | } _SDRAW, *SDRAW;
13 |
14 | typedef void (SCRNCALL * SDRAWFN)(SDRAW sdraw, int maxy);
15 |
16 |
17 | #ifdef __cplusplus
18 | extern "C" {
19 | #endif
20 |
21 | const SDRAWFN *sdraw_getproctbl(const SCRNSURF *surf);
22 |
23 | #if defined(SUPPORT_PC9821)
24 | const SDRAWFN *sdraw_getproctblex(const SCRNSURF *surf);
25 | #endif
26 |
27 | #ifdef __cplusplus
28 | }
29 | #endif
30 |
31 |
--------------------------------------------------------------------------------
/vram/vram.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "cpucore.h"
3 | #include "vram.h"
4 |
5 |
6 | _VRAMOP vramop;
7 | UINT8 tramupdate[0x1000];
8 | UINT8 vramupdate[0x8000];
9 | #if defined(SUPPORT_PC9821)
10 | UINT8 vramex[0x80000];
11 | #endif
12 |
13 |
14 | void vram_initialize(void) {
15 |
16 | ZeroMemory(&vramop, sizeof(vramop));
17 | MEMM_VRAM(0);
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/win9x/cmmidi.h:
--------------------------------------------------------------------------------
1 |
2 | // ---- com manager midi for windows
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | extern const TCHAR cmmidi_midimapper[];
9 | #if defined(VERMOUTH_LIB)
10 | extern const TCHAR cmmidi_vermouth[];
11 | #endif
12 | #if defined(MT32SOUND_DLL)
13 | extern const TCHAR cmmidi_mt32sound[];
14 | #endif
15 | extern LPCTSTR cmmidi_mdlname[12];
16 |
17 | void cmmidi_initailize(void);
18 | COMMNG cmmidi_create(LPCTSTR midiout, LPCTSTR midiin, LPCTSTR module);
19 | void cmmidi_recvdata(HMIDIIN hdr, UINT32 data);
20 | void cmmidi_recvexcv(HMIDIIN hdr, MIDIHDR *data);
21 |
22 | #ifdef __cplusplus
23 | }
24 | #endif
25 |
26 |
--------------------------------------------------------------------------------
/win9x/cmpara.h:
--------------------------------------------------------------------------------
1 |
2 | // ---- com manager parallel for windows
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | COMMNG cmpara_create(UINT port);
9 |
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 |
14 |
--------------------------------------------------------------------------------
/win9x/cmserial.h:
--------------------------------------------------------------------------------
1 |
2 | // ---- com manager serial for windows
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | extern const UINT32 cmserial_speed[10];
9 |
10 | COMMNG cmserial_create(UINT port, UINT8 param, UINT32 speed);
11 |
12 | #ifdef __cplusplus
13 | }
14 | #endif
15 |
16 |
--------------------------------------------------------------------------------
/win9x/compiler.cpp:
--------------------------------------------------------------------------------
1 | // compiler.cpp : 標準インクルードファイルを含むソース ファイル
2 | // np2.pch : 生成されるプリコンパイル済ヘッダー
3 | // compiler.obj : 生成されるプリコンパイル済タイプ情報
4 |
5 | #include "compiler.h"
6 |
--------------------------------------------------------------------------------
/win9x/dclock.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | DCLOCK_WIDTH = 56,
4 | DCLOCK_HEIGHT = 12,
5 | DCLOCK_YALIGN = (56 / 8)
6 | };
7 |
8 |
9 | typedef struct {
10 | UINT8 *pos;
11 | UINT16 mask;
12 | UINT8 rolbit;
13 | UINT8 reserved;
14 | } DCPOS;
15 |
16 | typedef struct {
17 | const UINT8 *fnt;
18 | const DCPOS *pos;
19 | UINT8 flm[8];
20 | UINT8 now[8];
21 | UINT8 bak[8];
22 | UINT16 drawing;
23 | UINT8 clk_x;
24 | UINT8 _padding;
25 | UINT8 dat[(DCLOCK_HEIGHT * DCLOCK_YALIGN) + 4];
26 | } _DCLOCK, *DCLOCK;
27 |
28 | typedef struct {
29 | RGB32 pal32[4];
30 | RGB16 pal16[4];
31 | UINT32 pal8[4][16];
32 | } DCLOCKPAL;
33 |
34 |
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | extern _DCLOCK dclock;
40 | extern DCLOCKPAL dclockpal;
41 |
42 | void dclock_init(void);
43 | void dclock_palset(UINT bpp);
44 | void dclock_reset(void);
45 | void dclock_callback(void);
46 | void dclock_redraw(void);
47 | BOOL dclock_disp(void);
48 | void dclock_cntdown(UINT8 value);
49 | void dclock_make(void);
50 | void dclock_out8(void *ptr, UINT yalign);
51 | void dclock_out16(void *ptr, UINT yalign);
52 | void dclock_out24(void *ptr, UINT yalign);
53 | void dclock_out32(void *ptr, UINT yalign);
54 |
55 | #ifdef __cplusplus
56 | }
57 | #endif
58 |
59 |
--------------------------------------------------------------------------------
/win9x/dd2.h:
--------------------------------------------------------------------------------
1 |
2 | #include "cmndraw.h"
3 |
4 | #define DD2HDL void *
5 |
6 |
7 | DD2HDL dd2_create(HWND hwnd, int width, int height);
8 | void dd2_release(DD2HDL dd2hdl);
9 | CMNVRAM *dd2_bsurflock(DD2HDL dd2);
10 | void dd2_bsurfunlock(DD2HDL dd2);
11 | void dd2_blt(DD2HDL dd2, const POINT *pt, const RECT *rect);
12 | UINT16 dd2_get16pal(DD2HDL dd2, RGB32 pal);
13 |
14 |
--------------------------------------------------------------------------------
/win9x/debuguty/view1mb.h:
--------------------------------------------------------------------------------
1 |
2 | LRESULT CALLBACK view1mb_proc(NP2VIEW_T *view,
3 | HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
4 |
5 | void view1mb_init(NP2VIEW_T *dst, NP2VIEW_T *src);
6 |
7 |
--------------------------------------------------------------------------------
/win9x/debuguty/viewasm.h:
--------------------------------------------------------------------------------
1 |
2 | void viewasm_reload(NP2VIEW_T *view);
3 |
4 | LRESULT CALLBACK viewasm_proc(NP2VIEW_T *view,
5 | HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
6 |
7 | void viewasm_init(NP2VIEW_T *dst, NP2VIEW_T *src);
8 |
9 |
--------------------------------------------------------------------------------
/win9x/debuguty/viewcmn.h:
--------------------------------------------------------------------------------
1 |
2 | extern const char viewcmn_hex[16];
3 |
4 |
5 | void viewcmn_caption(NP2VIEW_T *view, TCHAR *buf);
6 | void viewcmn_putcaption(NP2VIEW_T *view);
7 |
8 | BOOL viewcmn_alloc(VIEWMEMBUF *buf, UINT32 size);
9 | void viewcmn_free(VIEWMEMBUF *buf);
10 |
11 | NP2VIEW_T *viewcmn_find(HWND hwnd);
12 | void viewcmn_setmode(NP2VIEW_T *dst, NP2VIEW_T *src, UINT8 type);
13 | LRESULT CALLBACK viewcmn_dispat(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
14 | void viewcmn_setbank(NP2VIEW_T *view);
15 | void viewcmn_reload(NP2VIEW_T *view);
16 |
17 | void viewcmn_setmenuseg(HWND hwnd);
18 |
19 | void viewcmn_setvscroll(NP2VIEW_T *view);
20 |
21 | void viewcmn_paint(NP2VIEW_T *view, void (*callback)(NP2VIEW_T *view, RECT *rc, HDC hdc));
22 |
23 |
--------------------------------------------------------------------------------
/win9x/debuguty/viewmem.h:
--------------------------------------------------------------------------------
1 | extern const float CHAR_SPACING;
2 |
3 |
4 | void viewmem_read(VIEWMEM_T *cfg, UINT32 adrs, UINT8 *buf, UINT32 size);
5 | void viewmem_write(VIEWMEM_T *cfg, UINT32 adrs, UINT8 *buf, UINT32 size);
6 | void viewmem_lock_alloc(NP2VIEW_T *view, UINT32 alloctype);
7 |
8 | void viewmem_paint(NP2VIEW_T *view, RECT *rc, HDC hdc, UINT32 alloctype, BOOL segmented);
9 |
10 | LRESULT CALLBACK viewmem_proc(NP2VIEW_T *view, HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
11 |
12 |
13 | void viewmem_init(NP2VIEW_T *dst, NP2VIEW_T *src);
14 |
--------------------------------------------------------------------------------
/win9x/debuguty/viewmenu.h:
--------------------------------------------------------------------------------
1 | #ifdef __cplusplus
2 | extern "C" {
3 | #endif
4 |
5 | void viewmenu_mode(NP2VIEW_T *view);
6 | void viewmenu_lock(NP2VIEW_T *view);
7 | void viewmenu_debug_toggle(NP2VIEW_T *view, BOOL running);
8 | void viewmenu_all_debug_toggle(BOOL running);
9 |
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 |
--------------------------------------------------------------------------------
/win9x/debuguty/viewpaint.h:
--------------------------------------------------------------------------------
1 | /// Line functions
2 | /// --------------
3 | void viewpaint_line_fill(RECT *rc, HDC hdc, DWORD top, DWORD height, COLORREF col) ;
4 | COLORREF viewpaint_line_set_colors(NP2VIEW_T *view, RECT *rc, HDC hdc, DWORD y, UINT16 off, UINT16 cpu_seg, UINT16 cpu_off);
5 | /// --------------
6 |
7 | /// Common stuff
8 | /// ------------
9 | void viewpaint_print_addr(HDC hdc, int x, int y, UINT16 seg, UINT32 off, BOOL segmented);
10 | /// ------------
11 |
--------------------------------------------------------------------------------
/win9x/debuguty/viewreg.h:
--------------------------------------------------------------------------------
1 |
2 | LRESULT CALLBACK viewreg_proc(NP2VIEW_T *view,
3 | HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
4 |
5 | void viewreg_init(NP2VIEW_T *dst, NP2VIEW_T *src);
6 |
--------------------------------------------------------------------------------
/win9x/debuguty/viewseg.h:
--------------------------------------------------------------------------------
1 |
2 | LRESULT CALLBACK viewseg_proc(NP2VIEW_T *view,
3 | HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
4 |
5 | void viewseg_init(NP2VIEW_T *dst, NP2VIEW_T *src);
6 |
--------------------------------------------------------------------------------
/win9x/debuguty/viewsnd.h:
--------------------------------------------------------------------------------
1 |
2 | LRESULT CALLBACK viewsnd_proc(NP2VIEW_T *view,
3 | HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
4 |
5 | void viewsnd_init(NP2VIEW_T *dst, NP2VIEW_T *src);
6 |
7 |
--------------------------------------------------------------------------------
/win9x/debuguty/viewstat.h:
--------------------------------------------------------------------------------
1 | struct tagEditData;
2 | typedef struct tagEditData EDITDATA;
3 |
4 | void viewstat_found(NP2VIEW_T *view, EDITDATA *fd);
5 | void viewstat_notfound(NP2VIEW_T *view, EDITDATA *fd);
6 | void viewstat_update(NP2VIEW_T *view);
7 |
8 | #ifdef __cplusplus
9 | extern "C" {
10 | #endif
11 |
12 | void viewstat_memory_edit(NP2VIEW_T *view, EDITDATA *ed);
13 |
14 | void viewstat_breakpoint(NP2VIEW_T *view, np2break_t type, UINT32 addr);
15 | void viewstat_all_breakpoint(np2break_t type, UINT32 addr);
16 |
17 | #ifdef __cplusplus
18 | }
19 | #endif
20 |
21 | // -----------------------------------------------------------------------
22 |
23 | void viewstat_open(NP2VIEW_T *view, HINSTANCE hInstance);
24 | void viewstat_close(NP2VIEW_T *view);
25 |
--------------------------------------------------------------------------------
/win9x/debuguty/viewstk.h:
--------------------------------------------------------------------------------
1 | void viewstk_scroll_stack(NP2VIEW_T *view);
2 | void viewstk_reload(NP2VIEW_T *view);
3 |
4 | LRESULT CALLBACK viewstk_proc(NP2VIEW_T *view,
5 | HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
6 |
7 | void viewstk_init(NP2VIEW_T *dst, NP2VIEW_T *src);
8 |
--------------------------------------------------------------------------------
/win9x/dialog/dialog.h:
--------------------------------------------------------------------------------
1 | // All dialog procedures
2 | LRESULT CALLBACK CfgDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
3 | LRESULT CALLBACK AboutDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
4 | LRESULT CALLBACK MidiDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
5 | LRESULT CALLBACK ClndDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
6 | LRESULT CALLBACK AddrDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
7 | LRESULT CALLBACK EditDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
8 | LRESULT CALLBACK FindDialogProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
9 |
10 | void dialog_scropt(HWND hWnd);
11 | void dialog_sndopt(HWND hWnd);
12 | void dialog_s98(HWND hWnd);
13 | #if defined(SUPPORT_WAVEREC)
14 | void dialog_waverec(HWND hWnd);
15 | #endif
16 | void dialog_serial(HWND hWnd);
17 | void dialog_newdisk(HWND hWnd);
18 | void dialog_changefdd(HWND hWnd, REG8 drv);
19 | void dialog_changehdd(HWND hWnd, REG8 drv);
20 | void dialog_changedir(HWND hWnd, UINT drive);
21 | void dialog_font(HWND hWnd);
22 | void dialog_writebmp(HWND hWnd);
23 |
24 |
--------------------------------------------------------------------------------
/win9x/dialog/np2class.h:
--------------------------------------------------------------------------------
1 |
2 | // 猫用、拡張クラス。
3 |
4 |
5 | extern const TCHAR np2dlgclass[];
6 |
7 | void np2class_initialize(HINSTANCE hinst);
8 | void np2class_deinitialize(void);
9 |
10 | void np2class_move(HWND hWnd, int posx, int posy, int cx, int cy);
11 | int CALLBACK np2class_propetysheet(HWND hWndDlg, UINT uMsg, LPARAM lParam);
12 |
13 |
14 | // ---- class
15 |
16 | #define NP2GWLP_HMENU (0 * sizeof(LONG_PTR))
17 | #define NP2GWLP_SIZE (1 * sizeof(LONG_PTR))
18 |
19 | void np2class_wmcreate(HWND hWnd);
20 | void np2class_wmdestroy(HWND hWnd);
21 | void np2class_enablemenu(HWND hWnd, BOOL enable);
22 | void np2class_windowtype(HWND hWnd, UINT8 type);
23 | void np2class_frametype(HWND hWnd, UINT8 thick);
24 | HMENU np2class_gethmenu(HWND hWnd);
25 |
26 | WINLOCEX np2class_entersizemove(HWND hWnd, WINLOCEX in);
27 | WINLOCEX np2class_exitsizemove(HWND hWnd, WINLOCEX in);
28 | LRESULT CALLBACK np2class_wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
--------------------------------------------------------------------------------
/win9x/ext/externalchip.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file externalchip.h
3 | * @brief Interface of thg external modules
4 | */
5 |
6 | #pragma once
7 |
8 | /**
9 | * @brief The interface of thg external modules
10 | */
11 | class IExternalChip
12 | {
13 | public:
14 | /**
15 | * ChipType
16 | */
17 | enum ChipType
18 | {
19 | kNone = 0,
20 | kYM2608,
21 | kYM3438,
22 | kYMF288
23 | };
24 |
25 | /**
26 | * MessageType
27 | */
28 | enum
29 | {
30 | kMute = 0,
31 | kBusy
32 | };
33 |
34 | /**
35 | * Destructor
36 | */
37 | virtual ~IExternalChip()
38 | {
39 | }
40 |
41 | /**
42 | * Get chip type
43 | * @return The type of the chip
44 | */
45 | virtual ChipType GetChipType() = 0;
46 |
47 | /**
48 | * Reset
49 | */
50 | virtual void Reset() = 0;
51 |
52 | /**
53 | * Writes register
54 | * @param[in] nAddr The address
55 | * @param[in] cData The data
56 | */
57 | virtual void WriteRegister(UINT nAddr, UINT8 cData) = 0;
58 |
59 | /**
60 | * Message
61 | * @param[in] nMessage The message
62 | * @param[in] nParameter The parameter
63 | * @return Result
64 | */
65 | virtual INTPTR Message(UINT nMessage, INTPTR nParameter = 0) = 0;
66 | };
67 |
--------------------------------------------------------------------------------
/win9x/ext/externalchipmanager.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file externalchipmanager.h
3 | * @brief 外部チップ管理クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | #include
9 | #include "externalchip.h"
10 | #include "c86ctl\c86ctlif.h"
11 | #include "romeo\juliet.h"
12 | #include "scci\scciif.h"
13 |
14 | /**
15 | * @brief 外部チップ管理クラス
16 | */
17 | class CExternalChipManager
18 | {
19 | public:
20 | static CExternalChipManager* GetInstance();
21 |
22 | CExternalChipManager();
23 | void Initialize();
24 | void Deinitialize();
25 | IExternalChip* GetInterface(IExternalChip::ChipType nChipType, UINT nClock);
26 | void Release(IExternalChip* pChip);
27 | void Reset();
28 | void Mute(bool bMute);
29 |
30 | private:
31 | static CExternalChipManager sm_instance; //!< 唯一のインスタンスです
32 | std::vector m_chips; //!< モジュール
33 |
34 | C86CtlIf m_c86ctl; //!< C86Ctl インスタンス
35 | CJuliet m_juliet; //!< ROMEO インスタンス
36 | CScciIf m_scci; //!< SCCI インスタンス
37 | IExternalChip* GetInterfaceInner(IExternalChip::ChipType nChipType, UINT nClock);
38 | };
39 |
40 | /**
41 | * インスタンスを得る
42 | * @return インスタンス
43 | */
44 | inline CExternalChipManager* CExternalChipManager::GetInstance()
45 | {
46 | return &sm_instance;
47 | }
48 |
--------------------------------------------------------------------------------
/win9x/ext/romeo/juliet.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/win9x/ext/romeo/juliet.h
--------------------------------------------------------------------------------
/win9x/ext/scci/scciif.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file scciif.h
3 | * @brief SCCI アクセス クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | #include
9 | #include "..\externalchip.h"
10 |
11 | class SoundInterfaceManager;
12 | class SoundChip;
13 |
14 | /**
15 | * @brief SCCI アクセス クラス
16 | */
17 | class CScciIf
18 | {
19 | public:
20 | CScciIf();
21 | ~CScciIf();
22 | bool Initialize();
23 | void Deinitialize();
24 | void Reset();
25 | IExternalChip* GetInterface(IExternalChip::ChipType nChipType, UINT nClock);
26 |
27 | private:
28 | HMODULE m_hModule; //!< モジュール
29 | SoundInterfaceManager* m_pManager; //!< マネージャ
30 |
31 | /**
32 | * @brief チップ クラス
33 | */
34 | class Chip : public IExternalChip
35 | {
36 | public:
37 | Chip(CScciIf* pScciIf, SoundChip* pSoundChip);
38 | virtual ~Chip();
39 | operator SoundChip*();
40 | virtual ChipType GetChipType();
41 | virtual void Reset();
42 | virtual void WriteRegister(UINT nAddr, UINT8 cData);
43 | virtual INTPTR Message(UINT nMessage, INTPTR nParameter = 0);
44 |
45 | private:
46 | CScciIf* m_pScciIf; //!< 親インスタンス
47 | SoundChip* m_pSoundChip; //!< チップ インスタンス
48 | };
49 |
50 | std::vector m_chips; //!< チップ
51 | void Detach(Chip* pChip);
52 | friend class Chip;
53 | };
54 |
--------------------------------------------------------------------------------
/win9x/fontmng.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | FDAT_BOLD = 0x01,
4 | FDAT_PROPORTIONAL = 0x02,
5 | FDAT_ALIAS = 0x04,
6 | FDAT_ANSI = 0x08,
7 | FDAT_SHIFTJIS = 0x10
8 | };
9 |
10 | enum {
11 | FDAT_DEPTH = 64,
12 | FDAT_DEPTHBIT = 6
13 | };
14 |
15 | typedef struct {
16 | int width;
17 | int height;
18 | int pitch;
19 | } _FNTDAT, *FNTDAT;
20 |
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | void *fontmng_create(int size, UINT type, const OEMCHAR *fontface);
26 | void fontmng_destroy(void *hdl);
27 |
28 | BRESULT fontmng_getsize(void *hdl, const OEMCHAR *string, POINT_T *pt);
29 | BRESULT fontmng_getdrawsize(void *hdl, const OEMCHAR *string, POINT_T *pt);
30 | FNTDAT fontmng_get(void *hdl, const OEMCHAR *string);
31 |
32 | #ifdef __cplusplus
33 | }
34 | #endif
35 |
36 |
--------------------------------------------------------------------------------
/win9x/ini.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file ini.h
3 | * @brief 設定ファイル アクセスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #include "profile.h"
7 |
8 | /**
9 | * 追加設定
10 | */
11 | enum
12 | {
13 | PFTYPE_ARGS16 = PFTYPE_USER, /*!< 16ビット配列 */
14 | PFTYPE_BYTE3, /*!< 3バイト */
15 | PFTYPE_KB, /*!< キーボード設定 */
16 | };
17 |
18 | #ifdef __cplusplus
19 | extern "C"
20 | {
21 | #endif
22 |
23 | void ini_read(LPCTSTR lpPath, LPCTSTR lpTitle, const PFTBL* lpTable, UINT nCount);
24 | void ini_write(LPCTSTR lpPath, LPCTSTR lpTitle, const PFTBL* lpTable, UINT nCount);
25 |
26 | void initgetfile(LPTSTR lpPath, UINT cchPath);
27 | void initload(void);
28 | void initsave(void);
29 |
30 | #ifdef __cplusplus
31 | }
32 | #endif
33 |
--------------------------------------------------------------------------------
/win9x/joymng.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | REG8 joymng_getstat(void);
7 |
8 | // ----
9 |
10 | void joymng_initialize(void);
11 | void joymng_sync(void);
12 |
13 | #ifdef __cplusplus
14 | }
15 | #endif
16 |
17 |
--------------------------------------------------------------------------------
/win9x/juliet.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/win9x/juliet.cpp
--------------------------------------------------------------------------------
/win9x/misc/extrom.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file extrom.h
3 | * @brief EXTROM リソース クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | /**
9 | * @brief EXTROM リソース クラス
10 | */
11 | class CExtRom
12 | {
13 | public:
14 | CExtRom();
15 | ~CExtRom();
16 | bool Open(LPCTSTR lpFilename);
17 | void Close();
18 | UINT Read(LPVOID lpBuffer, UINT cbBuffer);
19 | LONG Seek(LONG lDistanceToMove, DWORD dwMoveMethod);
20 |
21 | private:
22 | HGLOBAL m_hGlobal; //!< ハンドル
23 | LPVOID m_lpRes; //!< リソース
24 | UINT m_nSize; //!< サイズ
25 | UINT m_nPointer; //!< ポインタ
26 | };
27 |
--------------------------------------------------------------------------------
/win9x/misc/guard.h:
--------------------------------------------------------------------------------
1 | /*!
2 | * @file guard.h
3 | * @brief クリティカル セクション クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | /*!
9 | * @brief クリティカル セクション クラス
10 | */
11 | class CGuard
12 | {
13 | public:
14 | /*! コンストラクタ */
15 | CGuard() { ::InitializeCriticalSection(&m_cs); }
16 |
17 | /*! デストラクタ */
18 | ~CGuard() { ::DeleteCriticalSection(&m_cs); }
19 |
20 | /*! クリティカル セクション開始 */
21 | void Enter() { ::EnterCriticalSection(&m_cs); }
22 |
23 | /*! クリティカル セクション終了 */
24 | void Leave() { ::LeaveCriticalSection(&m_cs); }
25 |
26 | private:
27 | CRITICAL_SECTION m_cs; //!< クリティカル セクション情報
28 | };
29 |
--------------------------------------------------------------------------------
/win9x/misc/threadbase.h:
--------------------------------------------------------------------------------
1 | /*!
2 | * @file threadbase.h
3 | * @brief スレッド基底クラスの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | /*!
9 | * @brief スレッド基底クラス
10 | */
11 | class CThreadBase
12 | {
13 | public:
14 | CThreadBase();
15 | virtual ~CThreadBase();
16 |
17 | bool Start();
18 | void Stop();
19 | bool Restart();
20 | void SetStackSize(size_t nStackSize);
21 | static void Delay(unsigned int usec);
22 |
23 | protected:
24 | virtual bool Task() = 0; //!< スレッド タスク
25 |
26 | private:
27 | HANDLE m_hThread; //!< スレッド ハンドル
28 | DWORD m_dwThreadId; //!< スレッド ID
29 | bool m_bAbort; //!< 中断フラグ
30 | bool m_bDone; //!< 完了フラグ
31 | size_t m_nStackSize; //!< スタック サイズ
32 | static DWORD __stdcall ThreadProc(LPVOID pParam);
33 | };
34 |
35 | /**
36 | * スタック サイズの設定
37 | * @param[in] nStackSize スタック サイズ
38 | */
39 | inline void CThreadBase::SetStackSize(size_t nStackSize)
40 | {
41 | m_nStackSize = nStackSize;
42 | }
43 |
44 | /**
45 | * スリープ
46 | * @param[in] usec マイクロ秒
47 | */
48 | inline void CThreadBase::Delay(unsigned int usec)
49 | {
50 | ::Sleep((usec + 999) / 1000);
51 | }
52 |
--------------------------------------------------------------------------------
/win9x/misc/tickcounter.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file tickcounter.h
3 | * @brief TICK カウンタの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | #ifdef __cplusplus
9 | extern "C"
10 | {
11 | #endif // __cplusplus
12 |
13 | DWORD GetTickCounter();
14 |
15 | #ifdef __cplusplus
16 | }
17 | #endif // __cplusplus
18 |
--------------------------------------------------------------------------------
/win9x/misc/vc6macros.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file vc6macros.h
3 | * @brief VC6 用マクロ
4 | */
5 |
6 | #pragma once
7 |
8 | #ifndef _countof
9 | //! countof
10 | #define _countof(x) (sizeof((x)) / sizeof((x)[0]))
11 | #endif // _countof
12 |
13 | #if (_MSC_VER < 1300)
14 | //! for scope
15 | #define for if (0 /*NEVER*/) { /* no process */ } else for
16 |
17 | #endif // (_MSC_VER < 1300)
18 |
--------------------------------------------------------------------------------
/win9x/mountdir/md_dir.h:
--------------------------------------------------------------------------------
1 | // md_dir.h - mountdir/directory handling
2 | // ------
3 | // Author: Nmlgc
4 |
5 | extern INT8 cur_drive;
6 | extern OEMCHAR cur_dir[MAX_PATH];
7 |
8 | #ifdef __cplusplus
9 | extern "C" {
10 | #endif
11 |
12 | /// Drive handling
13 | /// ==============
14 | BOOL md_drive_set(UINT8 drive);
15 | OEMCHAR *md_drive_parse(OEMCHAR *new_dir);
16 | BOOL md_drive_free_space(UINT8 drive);
17 | /// ==============
18 |
19 | /// Directory handling
20 | /// ==================
21 | BOOL md_dir_set(UINT32 dir_seg4, UINT16 dir_off);
22 | BOOL md_dir_create(UINT32 dir_seg4, UINT16 dir_off);
23 | BOOL md_dir_remove(UINT32 dir_seg4, UINT16 dir_off);
24 | /// ==================
25 |
26 | void md_reset_dir();
27 |
28 | #ifdef __cplusplus
29 | }
30 | #endif
31 |
--------------------------------------------------------------------------------
/win9x/mountdir/md_util.h:
--------------------------------------------------------------------------------
1 | // md_util.h - mountdir/utility functions
2 | // ------
3 | // Author: Nmlgc
4 |
5 | #ifdef __cplusplus
6 | extern "C" {
7 | #endif
8 |
9 | /// Time conversion
10 | /// ===============
11 | UINT16 time2dos(const SYSTEMTIME *systime);
12 | UINT16 date2dos(const SYSTEMTIME *systime);
13 | BOOL dostime2wintime(FILETIME *win_time, const UINT16 dos_date, const UINT16 dos_time);
14 | /// ===============
15 |
16 | /// String conversion
17 | /// =================
18 | TCHAR* sjis2ucs2(CHAR *str_raw, TCHAR *str_ucs2, UINT16 len);
19 | TCHAR *mem_read_sjis2ucs2(CHAR *str_raw, TCHAR *str_ucs2, UINT32 seg4, UINT16 off, UINT16 len);
20 | /// =================
21 |
22 | /// File name conversion
23 | /// ====================
24 | // Selects either
25 | OEMCHAR* md_util_dos_fn(WIN32_FIND_DATA *w32fd);
26 | void md_util_fn_split(CHAR *f_name, CHAR *f_ext, const CHAR *asciiz_fn);
27 | void md_util_fn_combine(CHAR *asciiz_fn, const CHAR *f_name, const CHAR *f_ext);
28 | /// ====================
29 |
30 | #ifdef __cplusplus
31 | }
32 | #endif
33 |
--------------------------------------------------------------------------------
/win9x/mountdir/mountdir.h:
--------------------------------------------------------------------------------
1 | // mountdir.h - mountdir/root functions
2 | // ------
3 | // Author: Nmlgc
4 |
5 | #ifdef __cplusplus
6 | extern "C" {
7 | #endif
8 |
9 | void md_set_error(BOOL ret);
10 |
11 | void md_create(void);
12 | void md_reset(void);
13 | void md_destroy(void);
14 |
15 | BOOL md_int21();
16 |
17 | #ifdef __cplusplus
18 | }
19 | #endif
20 |
--------------------------------------------------------------------------------
/win9x/mousemng.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | uPD8255A_LEFTBIT = 0x80,
4 | uPD8255A_RIGHTBIT = 0x20
5 | };
6 |
7 | // ---- for windows
8 |
9 | enum {
10 | MOUSEMNG_LEFTDOWN = 0,
11 | MOUSEMNG_LEFTUP,
12 | MOUSEMNG_RIGHTDOWN,
13 | MOUSEMNG_RIGHTUP
14 | };
15 |
16 | enum {
17 | MOUSEPROC_SYSTEM = 0,
18 | MOUSEPROC_WINUI,
19 | MOUSEPROC_BG
20 | };
21 |
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | UINT8 mousemng_getstat(SINT16 *x, SINT16 *y, int clear);
28 | void mousemng_initialize(void);
29 | void mousemng_sync(void);
30 | BOOL mousemng_buttonevent(UINT event);
31 | void mousemng_enable(UINT proc);
32 | void mousemng_disable(UINT proc);
33 | void mousemng_toggle(UINT proc);
34 |
35 | #ifdef __cplusplus
36 | }
37 | #endif
38 |
--------------------------------------------------------------------------------
/win9x/np21.manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 | Neko Project 21
10 |
11 |
12 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/win9x/np21debug.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | _DEBUG;DEBUG;%(PreprocessorDefinitions)
9 | Disabled
10 | MultiThreadedDebugDLL
11 | Level3
12 | EditAndContinue
13 |
14 |
15 | true
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/win9x/np21x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(DXSDK_DIR)\Lib\x64;$(LibraryPath)
7 |
8 |
9 |
10 | ..\win9x\x64;%(AdditionalIncludeDirectories)
11 | _M_AMD64;%(PreprocessorDefinitions)
12 |
13 |
14 | .\x64;..\i386c\x64;..\io\x64
15 |
16 |
17 | false
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/win9x/np21x86.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(DXSDK_DIR)\Lib\x86;$(LibraryPath)
7 |
8 |
9 |
10 | ..\win9x\x86;%(AdditionalIncludeDirectories)
11 |
12 |
13 | .\x86;..\i386c\x86;..\io\x86
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/win9x/oemtext.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file oemtext.h
3 | * @breif Interface of the text converter
4 | */
5 |
6 | #pragma once
7 |
8 | #include "codecnv/codecnv.h"
9 |
10 | #ifdef __cplusplus
11 | extern "C"
12 | {
13 | #endif
14 |
15 | UINT oemtext_mbtoucs2(UINT cp, wchar_t *dst, UINT dcnt, const char *src, UINT scnt);
16 | UINT oemtext_ucs2tomb(UINT cp, char *dst, UINT dcnt, const wchar_t *src, UINT scnt);
17 | UINT oemtext_mbtoutf8(UINT cp, char *dst, UINT dcnt, const char *src, UINT scnt);
18 | UINT oemtext_utf8tomb(UINT cp, char *dst, UINT dcnt, const char *src, UINT scnt);
19 |
20 | UINT oemtext_chartoucs2(wchar_t *dst, UINT dcnt, const char *src, UINT scnt);
21 | UINT oemtext_ucs2tochar(char *dst, UINT dcnt, const wchar_t *src, UINT scnt);
22 | UINT oemtext_chartoutf8(char *dst, UINT dcnt, const char *src, UINT scnt);
23 | UINT oemtext_utf8tochar(char *dst, UINT dcnt, const char *src, UINT scnt);
24 |
25 | #ifdef __cplusplus
26 | }
27 | #endif
28 |
29 | #if defined(OSLANG_UCS2)
30 | #define oemtext_sjistooem(a, b, c, d) oemtext_mbtoucs2(932, a, b, c, d)
31 | #define oemtext_oemtosjis(a, b, c, d) oemtext_ucs2tomb(932, a, b, c, d)
32 | #endif
33 |
--------------------------------------------------------------------------------
/win9x/resources/fddseek.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/win9x/resources/fddseek.wav
--------------------------------------------------------------------------------
/win9x/resources/fddseek1.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/win9x/resources/fddseek1.wav
--------------------------------------------------------------------------------
/win9x/resources/nekop2.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/win9x/resources/nekop2.bmp
--------------------------------------------------------------------------------
/win9x/resources/np2.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/win9x/resources/np2.ico
--------------------------------------------------------------------------------
/win9x/resources/np2debug.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/win9x/resources/np2debug.ico
--------------------------------------------------------------------------------
/win9x/resources/np2tool.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/win9x/resources/np2tool.bmp
--------------------------------------------------------------------------------
/win9x/soundmng.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file soundmng.h
3 | * @brief サウンド マネージャの宣言およびインターフェイスの定義をします
4 | */
5 |
6 | #pragma once
7 |
8 | #ifdef __cplusplus
9 | extern "C"
10 | {
11 | #endif
12 |
13 | /**
14 | * PCM 番号
15 | */
16 | typedef enum
17 | {
18 | SOUND_PCMSEEK = 0, /*!< ヘッド移動 */
19 | SOUND_PCMSEEK1 /*!< 1クラスタ移動 */
20 | } SoundPCMNumber;
21 |
22 | UINT soundmng_create(UINT rate, UINT ms);
23 | void soundmng_destroy(void);
24 | void soundmng_reset(void);
25 | void soundmng_play(void);
26 | void soundmng_stop(void);
27 | void soundmng_sync(void);
28 | void soundmng_setreverse(BOOL bReverse);
29 |
30 | BRESULT soundmng_pcmplay(SoundPCMNumber nNum, BOOL bLoop);
31 | void soundmng_pcmstop(SoundPCMNumber nNum);
32 |
33 | // ---- for windows
34 |
35 | BRESULT soundmng_initialize(void);
36 | void soundmng_deinitialize(void);
37 |
38 | void soundmng_pcmload(SoundPCMNumber nNum, LPCTSTR lpFilename);
39 | void soundmng_pcmvolume(SoundPCMNumber nNum, int nVolume);
40 |
41 | /**
42 | * サウンド プロシージャ
43 | */
44 | typedef enum
45 | {
46 | SNDPROC_MASTER = 0,
47 | SNDPROC_MAIN,
48 | SNDPROC_TOOL,
49 | SNDPROC_SUBWIND
50 | } SoundProc;
51 |
52 | void soundmng_enable(SoundProc nProc);
53 | void soundmng_disable(SoundProc nProc);
54 |
55 | #ifdef __cplusplus
56 | }
57 | #endif
58 |
--------------------------------------------------------------------------------
/win9x/taskmng.cpp:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "taskmng.h"
3 |
4 |
5 | void taskmng_exit(void) {
6 |
7 | PostQuitMessage(0);
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/win9x/taskmng.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | void taskmng_exit(void);
7 |
8 | #ifdef __cplusplus
9 | }
10 | #endif
11 |
12 |
--------------------------------------------------------------------------------
/win9x/timemng.cpp:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include "timemng.h"
3 |
4 |
5 | BRESULT timemng_gettime(_SYSTIME *systime) {
6 |
7 | GetLocalTime((SYSTEMTIME *)systime);
8 | return(SUCCESS);
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/win9x/timemng.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | // Win32 SYSTEMTIME ストラクチャ
4 |
5 | typedef struct {
6 | UINT16 year;
7 | UINT16 month;
8 | UINT16 week;
9 | UINT16 day;
10 | UINT16 hour;
11 | UINT16 minute;
12 | UINT16 second;
13 | UINT16 milli;
14 | } _SYSTIME;
15 |
16 |
17 | #ifdef __cplusplus
18 | extern "C" {
19 | #endif
20 |
21 | BRESULT timemng_gettime(_SYSTIME *systime);
22 |
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 |
27 |
--------------------------------------------------------------------------------
/win9x/toolwin.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | SKINMRU_MAX = 4,
4 | FDDLIST_DRV = 2,
5 | FDDLIST_MAX = 8
6 | };
7 |
8 | typedef struct {
9 | int insert;
10 | UINT cnt;
11 | UINT pos[FDDLIST_MAX];
12 | OEMCHAR name[FDDLIST_MAX][MAX_PATH];
13 | } TOOLFDD;
14 |
15 | typedef struct {
16 | int posx;
17 | int posy;
18 | BOOL type;
19 | TOOLFDD fdd[FDDLIST_DRV];
20 | OEMCHAR skin[MAX_PATH];
21 | OEMCHAR skinmru[SKINMRU_MAX][MAX_PATH];
22 | } NP2TOOL;
23 |
24 |
25 | extern NP2TOOL np2tool;
26 |
27 | #ifdef __cplusplus
28 | extern "C" {
29 | #endif
30 |
31 | BOOL toolwin_initapp(HINSTANCE hInstance);
32 | void toolwin_create(HINSTANCE hInstance);
33 | void toolwin_destroy(void);
34 | HWND toolwin_gethwnd(void);
35 |
36 | void toolwin_setfdd(UINT8 drv, const OEMCHAR *name);
37 |
38 | void toolwin_fddaccess(UINT8 drv);
39 | void toolwin_hddaccess(UINT8 drv);
40 | void toolwin_draw(UINT8 frame);
41 |
42 | void toolwin_readini(void);
43 | void toolwin_writeini(void);
44 |
45 | #ifdef __cplusplus
46 | }
47 | #endif
48 |
--------------------------------------------------------------------------------
/win9x/toolwin.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/win9x/toolwin.res
--------------------------------------------------------------------------------
/win9x/trace.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef TRACE
3 |
4 | #define TRACEINIT()
5 | #define TRACETERM()
6 | #define TRACEOUT(a)
7 | #define VERBOSE(a)
8 | #define APPDEVOUT(a)
9 |
10 | #else
11 |
12 | #ifdef __cplusplus
13 | extern "C" {
14 | #endif
15 |
16 | void trace_init(void);
17 | void trace_term(void);
18 | void trace_fmt(const char *str, ...);
19 | void trace_fmt2(const char *str, ...);
20 | void trace_char(char c);
21 | void trace_fileout(const OEMCHAR *fname);
22 |
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 |
27 | #define TRACEINIT() trace_init()
28 | #define TRACETERM() trace_term()
29 | #define TRACEOUT(arg) trace_fmt arg
30 | #define VERBOSE(arg) trace_fmt2 arg
31 | #define APPDEVOUT(arg) trace_char(arg)
32 |
33 | #endif
34 |
35 |
--------------------------------------------------------------------------------
/win9x/win32sub.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef STRICT
3 | #define SUBCLASSPROC WNDPROC
4 | #else
5 | #define SUBCLASSPROC FARPROC
6 | #endif
7 |
8 | // for VC6SDK
9 | #if (_MSC_VER < 1300)
10 | #ifndef LONG_PTR
11 | #define LONG_PTR LONG
12 | #endif
13 | #ifndef DWORD_PTR
14 | #define DWORD_PTR DWORD
15 | #endif
16 | #ifndef GetWindowLongPtr
17 | #define GetWindowLongPtr GetWindowLong
18 | #endif
19 | #ifndef SetWindowLongPtr
20 | #define SetWindowLongPtr SetWindowLong
21 | #endif
22 | #ifndef GWLP_WNDPROC
23 | #define GWLP_WNDPROC GWL_WNDPROC
24 | #endif
25 | #ifndef GWLP_HINSTANCE
26 | #define GWLP_HINSTANCE GWL_HINSTANCE
27 | #endif
28 | #ifndef GWLP_HWNDPARENT
29 | #define GWLP_HWNDPARENT GWL_HWNDPARENT
30 | #endif
31 | #ifndef GWLP_USERDATA
32 | #define GWLP_USERDATA GWL_USERDATA
33 | #endif
34 | #ifndef GWLP_ID
35 | #define GWLP_ID GWL_ID
36 | #endif
37 | #endif
38 |
39 | #define LOADSTRING LoadString
40 |
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 | void __msgbox(const char *title, const char *msg);
46 | int loadstringresource(UINT uID, LPTSTR lpszBuffer, int nBufferMax);
47 | LPTSTR lockstringresource(LPCTSTR lpcszString);
48 | void unlockstringresource(LPTSTR lpszString);
49 |
50 | #ifdef __cplusplus
51 | }
52 | #endif
53 |
54 |
--------------------------------------------------------------------------------
/win9x/winkbd.h:
--------------------------------------------------------------------------------
1 |
2 | enum {
3 | KEY_PC98 = 0,
4 | KEY_KEY101 = 1,
5 | KEY_KEY106 = 2,
6 | KEY_TYPEMAX = 3,
7 | KEY_UNKNOWN = 0xff
8 | };
9 |
10 | void winkbd_keydown(WPARAM wParam, LPARAM lParam);
11 | void winkbd_keyup(WPARAM wParam, LPARAM lParam);
12 | void winkbd_roll(BOOL pcat);
13 | void winkbd_setf12(UINT f12key);
14 | void winkbd_resetf12(void);
15 |
16 |
--------------------------------------------------------------------------------
/win9x/winloc.h:
--------------------------------------------------------------------------------
1 |
2 | void winloc_setclientsize(HWND hwnd, int width, int height);
3 |
4 |
5 | // ----
6 |
7 | typedef struct {
8 | UINT flag;
9 | int gx;
10 | int gy;
11 | int tx;
12 | int ty;
13 | } WINLOC;
14 |
15 | void winloc_movingstart(WINLOC *wl);
16 | void winloc_movingproc(WINLOC *wl, RECT *rect);
17 |
18 |
19 | // ----
20 |
21 | typedef struct {
22 | HWND hwnd;
23 | RECT rect;
24 | UINT8 connect;
25 | UINT8 padding;
26 | UINT16 parent;
27 | } WLEXWND;
28 |
29 | typedef struct {
30 | UINT flagx;
31 | UINT flagy;
32 | int gx;
33 | int gy;
34 | int tx;
35 | int ty;
36 | HWND base;
37 | RECT rect;
38 | HWND hold;
39 | UINT holdflag;
40 | UINT count;
41 | } _WINLOCEX, *WINLOCEX;
42 |
43 | WINLOCEX winlocex_create(HWND base, const HWND *child, UINT count);
44 | void winlocex_destroy(WINLOCEX wle);
45 | void winlocex_setholdwnd(WINLOCEX wle, HWND hold);
46 | void winlocex_moving(WINLOCEX wle, RECT *rect);
47 | void winlocex_move(WINLOCEX wle);
48 | void winlocex_close(WINLOCEX wle);
49 |
50 |
--------------------------------------------------------------------------------
/win9x/x64/pccore.inc:
--------------------------------------------------------------------------------
1 |
2 | struc np2cfg_t
3 | .uPD72020 resb 1
4 | .DISPSYNC resb 1
5 | .RASTER resb 1
6 | .realpal resb 1
7 | endstruc
8 |
9 |
--------------------------------------------------------------------------------
/win9x/x64/vram.inc:
--------------------------------------------------------------------------------
1 |
2 | SCRN_BUFSIZE equ 0x4b000
3 |
4 |
5 | struc vramop_t
6 | .operate resd 1
7 | .tramwait resd 1
8 | .vramwait resd 1
9 | .grcgwait resd 1
10 | endstruc
11 |
12 | struc dsync_t
13 | .text_vbp resd 1
14 | .textymax resd 1
15 | .grph_vbp resd 1
16 | .grphymax resd 1
17 |
18 | .scrnxpos resd 1
19 | .scrnxmax resd 1
20 | .scrnxextend resd 1
21 | .scrnymax resd 1
22 | .textvad resd 1
23 | .grphvad resd 1
24 | endstruc
25 |
26 |
--------------------------------------------------------------------------------
/win9x/x86/cputype.h:
--------------------------------------------------------------------------------
1 |
2 | #ifdef __cplusplus
3 | extern "C" {
4 | #endif
5 |
6 | int havemmx(void);
7 |
8 | #ifdef __cplusplus
9 | }
10 | #endif
11 |
12 |
--------------------------------------------------------------------------------
/win9x/x86/cputype.x86:
--------------------------------------------------------------------------------
1 |
2 | section .text
3 |
4 | global _havemmx
5 |
6 | align 16
7 | _havemmx: pushfd
8 | pop eax
9 | mov edx, eax
10 | xor eax, 00200000h
11 | push eax
12 | popfd
13 | pushfd
14 | pop eax
15 | sub eax, edx
16 | je short nocpuid
17 | xor eax, eax
18 | inc eax
19 | push ebx
20 | cpuid
21 | pop ebx
22 | mov eax, edx
23 | and eax, 00800000h
24 | nocpuid: ret
25 |
26 |
--------------------------------------------------------------------------------
/win9x/x86/np2asm.inc:
--------------------------------------------------------------------------------
1 |
2 | USE_EGCASM equ 1
3 |
4 | EARG1 equ 4
5 | EARG2 equ (EARG1+4)
6 | EARG3 equ (EARG2+4)
7 | EARG4 equ (EARG3+4)
8 |
9 | FC_ARG3 equ 4
10 | FC_ARG4 equ (FC_ARG3+4)
11 | FC_ARG5 equ (FC_ARG4+4)
12 | FC_ARG6 equ (FC_ARG5+4)
13 |
14 |
--------------------------------------------------------------------------------
/win9x/x86/pccore.inc:
--------------------------------------------------------------------------------
1 |
2 | struc np2cfg_t
3 | .uPD72020 resb 1
4 | .DISPSYNC resb 1
5 | .RASTER resb 1
6 | .realpal resb 1
7 | endstruc
8 |
9 |
--------------------------------------------------------------------------------
/win9x/x86/vram.inc:
--------------------------------------------------------------------------------
1 |
2 | SCRN_BUFSIZE equ 0x4b000
3 |
4 |
5 | struc vramop_t
6 | .operate resd 1
7 | .tramwait resd 1
8 | .vramwait resd 1
9 | .grcgwait resd 1
10 | endstruc
11 |
12 | struc dsync_t
13 | .text_vbp resd 1
14 | .textymax resd 1
15 | .grph_vbp resd 1
16 | .grphymax resd 1
17 |
18 | .scrnxpos resd 1
19 | .scrnxmax resd 1
20 | .scrnxextend resd 1
21 | .scrnymax resd 1
22 | .textvad resd 1
23 | .grphvad resd 1
24 | endstruc
25 |
26 |
--------------------------------------------------------------------------------
/x11/autogen.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | aclocal
3 | autoheader
4 | automake -aci --foreign
5 | autoconf
6 | rm -f config.h.in~
7 | ./configure "$@"
8 | rm -f ../np2tool/np2tool.d88
9 | ( cd ../np2tool && unzip -j -o np2tool.zip )
10 |
11 |
--------------------------------------------------------------------------------
/x11/cmmidi.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_X11_CMMIDI_H__
2 | #define NP2_X11_CMMIDI_H__
3 |
4 | // ---- com manager midi for unix
5 |
6 | G_BEGIN_DECLS
7 |
8 | extern COMMNG cm_mpu98;
9 |
10 | enum {
11 | MIDI_MT32 = 0,
12 | MIDI_CM32L,
13 | MIDI_CM64,
14 | MIDI_CM300,
15 | MIDI_CM500LA,
16 | MIDI_CM500GS,
17 | MIDI_SC55,
18 | MIDI_SC88,
19 | MIDI_LA,
20 | MIDI_GM,
21 | MIDI_GS,
22 | MIDI_XG,
23 | MIDI_OTHER
24 | };
25 |
26 | #if defined(VERMOUTH_LIB)
27 | extern const char cmmidi_vermouth[];
28 | #endif
29 | extern const char cmmidi_midiout_device[];
30 | extern const char cmmidi_midiin_device[];
31 |
32 | extern const char *cmmidi_mdlname[];
33 |
34 | void cmmidi_initailize(void);
35 | COMMNG cmmidi_create(const char *midiout, const char *midiin, const char *module);
36 |
37 | G_END_DECLS
38 |
39 | #endif /* NP2_X11_CMMIDI_H__ */
40 |
--------------------------------------------------------------------------------
/x11/cmpara.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_X11_CMPARA_H__
2 | #define NP2_X11_CMPARA_H__
3 |
4 | // ---- com manager parallel for unix
5 |
6 | G_BEGIN_DECLS
7 |
8 | G_END_DECLS
9 |
10 | #endif /* NP2_X11_CMPARA_H__ */
11 |
--------------------------------------------------------------------------------
/x11/cmserial.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_X11_CMSERIAL_H__
2 | #define NP2_X11_CMSERIAL_H__
3 |
4 | // ---- com manager serial for unix
5 |
6 | G_BEGIN_DECLS
7 |
8 | extern const UINT32 cmserial_speed[10];
9 |
10 | COMMNG cmserial_create(UINT port, UINT8 param, UINT32 speed);
11 |
12 | #if defined(SUPPORT_PC9861K)
13 | #define MAX_SERIAL_PORT_NUM 3
14 | #else
15 | #define MAX_SERIAL_PORT_NUM 1
16 | #endif
17 |
18 | G_END_DECLS
19 |
20 | #endif /* NP2_X11_CMSERIAL_H__ */
21 |
--------------------------------------------------------------------------------
/x11/debug/debugwin.h:
--------------------------------------------------------------------------------
1 | #if defined(SUPPORT_MEMDBG32)
2 |
3 | G_BEGIN_DECLS
4 |
5 | void debugwin_create(void);
6 | void debugwin_destroy(void);
7 | void debugwin_process(void);
8 |
9 | G_END_DECLS
10 |
11 | #else
12 |
13 | #define debugwin_create()
14 | #define debugwin_destroy()
15 | #define debugwin_process()
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/x11/debug/viewmem.h:
--------------------------------------------------------------------------------
1 | #if defined(SUPPORT_VIEWER)
2 |
3 | G_BEGIN_DECLS
4 |
5 | void viewmem_read(VIEWMEM_T *cfg, UINT32 adrs, UINT8 *buf, UINT32 size);
6 | void viewmem_write(VIEWMEM_T *cfg, UINT32 adrs, UINT8 *buf, UINT32 size);
7 |
8 | G_END_DECLS
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/x11/drawmng.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 |
3 | #include "drawmng.h"
4 |
5 |
6 | void
7 | drawmng_make16mask(PAL16MASK *pal16, UINT32 bmask, UINT32 rmask, UINT32 gmask)
8 | {
9 | UINT8 sft;
10 |
11 | if (pal16 == NULL)
12 | return;
13 |
14 | sft = 0;
15 | while ((!(bmask & 0x80)) && (sft < 32)) {
16 | bmask <<= 1;
17 | sft++;
18 | }
19 | pal16->mask.p.b = (UINT8)bmask;
20 | pal16->r16b = sft;
21 |
22 | sft = 0;
23 | while ((rmask & 0xffffff00) && (sft < 32)) {
24 | rmask >>= 1;
25 | sft++;
26 | }
27 | pal16->mask.p.r = (UINT8)rmask;
28 | pal16->l16r = sft;
29 |
30 | sft = 0;
31 | while ((gmask & 0xffffff00) && (sft < 32)) {
32 | gmask >>= 1;
33 | sft++;
34 | }
35 | pal16->mask.p.g = (UINT8)gmask;
36 | pal16->l16g = sft;
37 | }
38 |
39 | RGB16
40 | drawmng_makepal16(PAL16MASK *pal16, RGB32 pal32)
41 | {
42 | RGB32 pal;
43 |
44 | pal.d = pal32.d & pal16->mask.d;
45 | return (RGB16)((pal.p.g << pal16->l16g) + (pal.p.r << pal16->l16r) + (pal.p.b >> pal16->r16b));
46 | }
47 |
--------------------------------------------------------------------------------
/x11/fontmng.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 |
3 | #include "np2.h"
4 | #include "fontmng.h"
5 |
--------------------------------------------------------------------------------
/x11/fontmng.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_X11_FONTMNG_H__
2 | #define NP2_X11_FONTMNG_H__
3 |
4 | G_BEGIN_DECLS
5 |
6 | enum {
7 | FDAT_BOLD = 0x01,
8 | FDAT_PROPORTIONAL = 0x02,
9 | FDAT_ALIAS = 0x04,
10 | FDAT_ANSI = 0x08
11 | };
12 |
13 | enum {
14 | FDAT_DEPTH = 255,
15 | FDAT_DEPTHBIT = 8
16 | };
17 |
18 | typedef struct {
19 | int width;
20 | int height;
21 | int pitch;
22 | } _FNTDAT, *FNTDAT;
23 |
24 | BOOL fontmng_init(void);
25 | void fontmng_terminate(void);
26 | void fontmng_setdeffontname(const OEMCHAR *fontface);
27 | void* fontmng_create(int size, UINT type, const OEMCHAR *fontface);
28 | void fontmng_destroy(void *hdl);
29 |
30 | BOOL fontmng_getsize(void *hdl, const char *string, POINT_T *pt);
31 | BOOL fontmng_getdrawsize(void *hdl, const char *string, POINT_T *pt);
32 | FNTDAT fontmng_get(void *hdl, const char *string);
33 |
34 | G_END_DECLS
35 |
36 | #endif /* NP2_X11_FONTMNG_H__ */
37 |
--------------------------------------------------------------------------------
/x11/ini.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_X11_INI_H__
2 | #define NP2_X11_INI_H__
3 |
4 | G_BEGIN_DECLS
5 |
6 | enum {
7 | INITYPE_STR = 0,
8 | INITYPE_BOOL,
9 | INITYPE_BITMAP,
10 | INITYPE_ARGS16,
11 | INITYPE_ARGH8,
12 | INITYPE_SINT8,
13 | INITYPE_SINT16,
14 | INITYPE_SINT32,
15 | INITYPE_UINT8,
16 | INITYPE_UINT16,
17 | INITYPE_UINT32,
18 | INITYPE_HEX8,
19 | INITYPE_HEX16,
20 | INITYPE_HEX32,
21 | INITYPE_BYTE3,
22 | INITYPE_KB,
23 | INITYPE_USER,
24 | INITYPE_SNDDRV,
25 | INITYPE_INTERP,
26 | INITYPE_MASK = 0xff,
27 |
28 | INIFLAG_RO = 0x0100,
29 | INIFLAG_MAX = 0x0200,
30 | INIFLAG_AND = 0x0400,
31 | };
32 |
33 | typedef struct {
34 | char item[10];
35 | UINT16 itemtype;
36 | void *value;
37 | UINT32 arg;
38 | } INITBL;
39 |
40 | void ini_read(const char *path, const char *title, INITBL *tbl, UINT count);
41 | void ini_write(const char *path, const char *title, INITBL *tbl, UINT count, BOOL create);
42 |
43 | void initload(void);
44 | void initsave(void);
45 |
46 | G_END_DECLS
47 |
48 | #endif /* NP2_X11_INI_H__ */
49 |
--------------------------------------------------------------------------------
/x11/kdispwin.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 |
3 | #if defined(SUPPORT_KEYDISP)
4 |
5 | #include "np2.h"
6 | #include "dosio.h"
7 | #include "ini.h"
8 |
9 | #include "kdispwin.h"
10 |
11 | KDISPCFG kdispcfg;
12 |
13 |
14 | BOOL
15 | kdispwin_initialize(void)
16 | {
17 |
18 | keydisp_initialize();
19 |
20 | return SUCCESS;
21 | }
22 |
23 |
24 | // ---- ini
25 |
26 | static const char ini_title[] = "NP2 keydisp";
27 |
28 | static INITBL iniitem[] = {
29 | {"WindposX", INITYPE_SINT32, &kdispcfg.posx, 0},
30 | {"WindposY", INITYPE_SINT32, &kdispcfg.posy, 0},
31 | {"keydmode", INITYPE_UINT8, &kdispcfg.mode, 0},
32 | {"windtype", INITYPE_BOOL, &kdispcfg.type, 0},
33 | };
34 | #define INIITEMS (sizeof(iniitem) / sizeof(iniitem[0]))
35 |
36 | void
37 | kdispwin_readini(void)
38 | {
39 | char path[MAX_PATH];
40 |
41 | memset(&kdispcfg, 0, sizeof(kdispcfg));
42 | kdispcfg.posx = 0;
43 | kdispcfg.posy = 0;
44 | file_cpyname(path, modulefile, sizeof(path));
45 | ini_read(path, ini_title, iniitem, INIITEMS);
46 | }
47 |
48 | void
49 | kdispwin_writeini(void)
50 | {
51 | char path[MAX_PATH];
52 |
53 | file_cpyname(path, modulefile, sizeof(path));
54 | ini_write(path, ini_title, iniitem, INIITEMS, FALSE);
55 | }
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/x11/kdispwin.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_X11_KDISPWIN_H__
2 | #define NP2_X11_KDISPWIN_H__
3 |
4 | #include "keydisp.h"
5 |
6 | #if defined(SUPPORT_KEYDISP)
7 |
8 | G_BEGIN_DECLS
9 |
10 | enum {
11 | KDISPCFG_FM = 0x00,
12 | KDISPCFG_MIDI = 0x80
13 | };
14 |
15 | typedef struct {
16 | int posx;
17 | int posy;
18 | UINT8 mode;
19 | UINT8 type;
20 | } KDISPCFG;
21 |
22 | extern KDISPCFG kdispcfg;
23 |
24 | BOOL kdispwin_initialize(void);
25 | void kdispwin_create(void);
26 | void kdispwin_destroy(void);
27 | void kdispwin_draw(UINT8 cnt);
28 | void kdispwin_readini(void);
29 | void kdispwin_writeini(void);
30 |
31 | G_END_DECLS
32 |
33 | #else /* !SUPPORT_KEYDISP */
34 |
35 | #define kdispwin_initialize()
36 | #define kdispwin_create()
37 | #define kdispwin_destroy()
38 | #define kdispwin_draw(cnt)
39 | #define kdispwin_readini()
40 | #define kdispwin_writeini()
41 |
42 | #endif /* SUPPORT_KEYDISP */
43 |
44 | #endif /* NP2_X11_KDISPWIN_H__ */
45 |
--------------------------------------------------------------------------------
/x11/oemtext.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 |
3 | #include "oemtext.h"
4 |
--------------------------------------------------------------------------------
/x11/oemtext.h:
--------------------------------------------------------------------------------
1 | #include "codecnv/codecnv.h"
2 |
3 | #if 1
4 | #define oemtext_sjistooem codecnv_sjistoeuc
5 | #define oemtext_oemtosjis codecnv_euctosjis
6 | #else
7 |
8 | G_BEGIN_DECLS
9 |
10 | UINT oemtext_sjistooem(OEMCHAR *dst, UINT dcnt, const char *src, UINT scnt);
11 | UINT oemtext_oemtosjis(char *dst, UINT dcnt, const OEMCHAR *src, UINT scnt);
12 |
13 | G_END_DECLS
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/x11/resources/fddseek.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/x11/resources/fddseek.wav
--------------------------------------------------------------------------------
/x11/resources/fddseek1.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmlgc/np2debug/fd715a005f8f5f3c84724900914ebe41121d0045/x11/resources/fddseek1.wav
--------------------------------------------------------------------------------
/x11/resources/np2.xbm:
--------------------------------------------------------------------------------
1 | #define np2_width 32
2 | #define np2_height 32
3 | static const char np2_bits[] = {
4 | 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfe, 0x7f, 0xf8, 0x0f, 0xf0, 0x0f, 0xf0,
5 | 0x8f, 0xc1, 0x83, 0xf1, 0x0f, 0x02, 0xc0, 0xf0, 0x0f, 0x04, 0x60, 0xf0,
6 | 0x1f, 0x04, 0xa0, 0xf8, 0x1f, 0x02, 0x40, 0xf8, 0x1f, 0x01, 0x80, 0xf8,
7 | 0x1f, 0x20, 0x04, 0xfc, 0x3f, 0x20, 0x04, 0xfc, 0x3f, 0x20, 0x04, 0xfc,
8 | 0x3f, 0x20, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0xcf, 0xf3, 0xff,
9 | 0x7f, 0xc0, 0x01, 0xfe, 0xff, 0x9f, 0xf8, 0xff, 0xff, 0x00, 0x00, 0xff,
10 | 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0x07, 0xe0, 0xff,
11 | 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x0f, 0xf8, 0xf8, 0xff, 0x07, 0xe0, 0xf8,
12 | 0xff, 0x03, 0xe0, 0xfa, 0xff, 0x03, 0xc0, 0xff, 0xff, 0x03, 0xc0, 0xff,
13 | 0xc7, 0x03, 0xc0, 0xe7, 0x0f, 0x24, 0x24, 0xf0, 0x1f, 0x44, 0x22, 0xf8,
14 | 0x7f, 0xc8, 0x33, 0xfe, 0xff, 0xff, 0xff, 0xff, };
15 |
--------------------------------------------------------------------------------
/x11/skbdwin.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 |
3 | #if defined(SUPPORT_SOFTKBD)
4 |
5 | #include "np2.h"
6 | #include "dosio.h"
7 | #include "ini.h"
8 |
9 | #include "skbdwin.h"
10 |
11 | SKBDCFG skbdcfg;
12 |
13 |
14 | BOOL
15 | skbdwin_initialize(void)
16 | {
17 |
18 | softkbd_initialize();
19 |
20 | return SUCCESS;
21 | }
22 |
23 | void
24 | skbdwin_deinitialize(void)
25 | {
26 |
27 | softkbd_deinitialize();
28 | }
29 |
30 |
31 | /* ---- ini */
32 |
33 | static const char ini_title[] = "NP2 software keyboard";
34 |
35 | static INITBL iniitem[] = {
36 | {"WindposX", INITYPE_SINT32, &skbdcfg.posx, 0},
37 | {"WindposY", INITYPE_SINT32, &skbdcfg.posy, 0},
38 | };
39 | #define INIITEMS (sizeof(iniitem) / sizeof(iniitem[0]))
40 |
41 | void
42 | skbdwin_readini(void)
43 | {
44 | char path[MAX_PATH];
45 |
46 | memset(&skbdcfg, 0, sizeof(skbdcfg));
47 | file_cpyname(path, modulefile, sizeof(path));
48 | ini_read(path, ini_title, iniitem, INIITEMS);
49 | }
50 |
51 | void
52 | skbdwin_writeini(void)
53 | {
54 | char path[MAX_PATH];
55 |
56 | file_cpyname(path, modulefile, sizeof(path));
57 | ini_write(path, ini_title, iniitem, INIITEMS, FALSE);
58 | }
59 | #endif
60 |
--------------------------------------------------------------------------------
/x11/skbdwin.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_X11_SKBDWIN_H__
2 | #define NP2_X11_SKBDWIN_H__
3 |
4 | #if defined(SUPPORT_SOFTKBD)
5 |
6 | #include "softkbd.h"
7 |
8 | G_BEGIN_DECLS
9 |
10 | typedef struct {
11 | int posx;
12 | int posy;
13 | UINT8 type;
14 | } SKBDCFG;
15 |
16 | extern SKBDCFG skbdcfg;
17 |
18 | BOOL skbdwin_initialize(void);
19 | void skbdwin_deinitialize(void);
20 | void skbdwin_create(void);
21 | void skbdwin_destroy(void);
22 | void skbdwin_process(void);
23 | void skbdwin_readini(void);
24 | void skbdwin_writeini(void);
25 |
26 | G_END_DECLS
27 |
28 | #else /* !SUPPORT_SOFTKBD */
29 |
30 | #define skbdwin_initialize()
31 | #define skbdwin_deinitialize()
32 | #define skbdwin_create()
33 | #define skbdwin_destroy()
34 | #define skbdwin_process()
35 | #define skbdwin_readini()
36 | #define skbdwin_writeini()
37 |
38 | #endif /* SUPPORT_SOFTKBD */
39 |
40 | #endif /* NP2_X11_SKBDWIN_H__ */
41 |
--------------------------------------------------------------------------------
/x11/sysmng.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_X11_SYSMNG_H__
2 | #define NP2_X11_SYSMNG_H__
3 |
4 | #include "toolwin.h"
5 |
6 | // どーでもいい通知系
7 |
8 | G_BEGIN_DECLS
9 |
10 | enum {
11 | SYS_UPDATECFG = 0x0001,
12 | SYS_UPDATEOSCFG = 0x0002,
13 | SYS_UPDATECLOCK = 0x0004,
14 | SYS_UPDATERATE = 0x0008,
15 | SYS_UPDATESBUF = 0x0010,
16 | SYS_UPDATEMIDI = 0x0020,
17 | SYS_UPDATESBOARD = 0x0040,
18 | SYS_UPDATEFDD = 0x0080,
19 | SYS_UPDATEHDD = 0x0100,
20 | SYS_UPDATEMEMORY = 0x0200,
21 | SYS_UPDATESERIAL1 = 0x0400
22 | };
23 |
24 | extern UINT sys_updates;
25 |
26 | #define sysmng_initialize() \
27 | do { \
28 | sys_updates = 0; \
29 | } while (/*CONSTCOND*/ 0)
30 |
31 | #define sysmng_update(a) \
32 | do { \
33 | sys_updates |= (a); \
34 | if ((a) & SYS_UPDATEFDD) \
35 | sysmng_updatecaption(1); \
36 | } while (/*CONSTCOND*/ 0)
37 |
38 | #define sysmng_cpureset() \
39 | do { \
40 | sys_updates &= (SYS_UPDATECFG | SYS_UPDATEOSCFG); \
41 | sysmng_workclockreset(); \
42 | } while (/*CONSTCOND*/ 0)
43 |
44 | #define sysmng_fddaccess(a) toolwin_fddaccess((a))
45 | #define sysmng_hddaccess(a) toolwin_hddaccess((a))
46 |
47 | void sysmng_workclockreset(void);
48 | BOOL sysmng_workclockrenewal(void);
49 | void sysmng_updatecaption(UINT8 flag);
50 |
51 | G_END_DECLS
52 |
53 | #endif /* NP2_X11_SYSMNG_H__ */
54 |
--------------------------------------------------------------------------------
/x11/taskmng.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 |
3 | #include "np2.h"
4 | #include "toolkit.h"
5 |
6 | #include "taskmng.h"
7 |
8 |
9 | void
10 | taskmng_initialize(void)
11 | {
12 |
13 | np2running = 1;
14 | }
15 |
16 | BOOL
17 | taskmng_sleep(UINT32 tick)
18 | {
19 | UINT32 base;
20 | UINT32 now;
21 |
22 | base = GETTICK();
23 | while (taskmng_isavail() && (((now = GETTICK()) - base) < tick)) {
24 | toolkit_event_process();
25 | usleep((tick - (now - base) / 2) * 1000);
26 | }
27 | return taskmng_isavail();
28 | }
29 |
30 | void
31 | taskmng_exit(void)
32 | {
33 |
34 | np2running = 0;
35 | }
36 |
--------------------------------------------------------------------------------
/x11/taskmng.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_X11_TASKMNG_H__
2 | #define NP2_X11_TASKMNG_H__
3 |
4 | #include "compiler.h"
5 |
6 | #include "np2.h"
7 |
8 | G_BEGIN_DECLS
9 |
10 | void taskmng_initialize(void);
11 | BOOL taskmng_sleep(UINT32 tick);
12 | void taskmng_exit(void);
13 |
14 | #define taskmng_isavail() np2running
15 |
16 | G_END_DECLS
17 |
18 | #endif /* NP2_X11_TASKMNG_H__ */
19 |
--------------------------------------------------------------------------------
/x11/timemng.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 |
3 | #include
4 |
5 | #include "timemng.h"
6 |
7 | BRESULT
8 | timemng_gettime(_SYSTIME *systime)
9 | {
10 | struct tm *now_time;
11 | time_t long_time;
12 |
13 | time(&long_time);
14 | now_time = localtime(&long_time);
15 | if (now_time != NULL) {
16 | systime->year = now_time->tm_year + 1900;
17 | systime->month = now_time->tm_mon + 1;
18 | systime->week = now_time->tm_wday;
19 | systime->day = now_time->tm_mday;
20 | systime->hour = now_time->tm_hour;
21 | systime->minute = now_time->tm_min;
22 | systime->second = now_time->tm_sec;
23 | systime->milli = 0;
24 |
25 | return SUCCESS;
26 | }
27 | return FAILURE;
28 | }
29 |
--------------------------------------------------------------------------------
/x11/timemng.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_X11_TIMEMNG_H__
2 | #define NP2_X11_TIMEMNG_H__
3 |
4 | G_BEGIN_DECLS
5 |
6 | // Win32 SYSTEMTIME 繧ケ繝医Λ繧ッ繝√Ε
7 |
8 | typedef struct {
9 | UINT16 year;
10 | UINT16 month;
11 | UINT16 week;
12 | UINT16 day;
13 | UINT16 hour;
14 | UINT16 minute;
15 | UINT16 second;
16 | UINT16 milli;
17 | } _SYSTIME;
18 |
19 | BRESULT timemng_gettime(_SYSTIME *systime);
20 |
21 | G_END_DECLS
22 |
23 | #endif /* NP2_X11_TIMEMNG_H__ */
24 |
--------------------------------------------------------------------------------
/x11/trace.c:
--------------------------------------------------------------------------------
1 | #include "compiler.h"
2 | #include
3 |
4 |
5 | int trace_flag = 0;
6 |
7 | void trace_init(void) {
8 | }
9 |
10 | void trace_term(void) {
11 | }
12 |
13 | void trace_fmt(const char *fmt, ...) {
14 |
15 | va_list ap;
16 | gchar buf[1024];
17 |
18 | va_start(ap, fmt);
19 | g_vsnprintf(buf, sizeof(buf), fmt, ap);
20 | va_end(ap);
21 | g_printerr("%s\n", buf);
22 | }
23 |
--------------------------------------------------------------------------------
/x11/trace.h:
--------------------------------------------------------------------------------
1 | #ifndef NP2_X11_TRACE_H__
2 | #define NP2_X11_TRACE_H__
3 |
4 | G_BEGIN_DECLS
5 |
6 | extern int trace_flag;
7 |
8 | void trace_init(void);
9 | void trace_term(void);
10 | void trace_fmt(const char *str, ...) G_GNUC_PRINTF(1, 2);
11 |
12 | #ifndef TRACE
13 |
14 | #define TRACEINIT()
15 | #define TRACETERM()
16 | #define TRACEOUT(a)
17 | #ifndef VERBOSE
18 | #define VERBOSE(s)
19 | #endif
20 |
21 | #else /* TRACE */
22 |
23 | #define TRACEINIT() trace_init()
24 | #define TRACETERM() trace_term()
25 | #define TRACEOUT(arg) trace_fmt arg
26 | #ifndef VERBOSE
27 | #define VERBOSE(arg) if (trace_flag) trace_fmt arg
28 | #endif
29 |
30 | #endif /* !TRACE */
31 |
32 | G_END_DECLS
33 |
34 | #endif /* NP2_X11_TRACE_H__ */
35 |
--------------------------------------------------------------------------------
/zlib/inffast.h:
--------------------------------------------------------------------------------
1 | /* inffast.h -- header to use inffast.c
2 | * Copyright (C) 1995-2003 Mark Adler
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* WARNING: this file should *not* be used by applications. It is
7 | part of the implementation of the compression library and is
8 | subject to change. Applications should only use zlib.h.
9 | */
10 |
11 | void inflate_fast OF((z_streamp strm, unsigned start));
12 |
--------------------------------------------------------------------------------
/zlib/readme.txt:
--------------------------------------------------------------------------------
1 |
2 | - zlib 1.2.2
3 |
4 |
--------------------------------------------------------------------------------