Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
blog:pc98_devcode [2020/08/22 10:22] – [Packed-Pixel or Chunky Video Modes] john | blog:pc98_devcode [2020/08/22 10:35] – [NEC PC-98 C Code Examples] john | ||
---|---|---|---|
Line 3: | Line 3: | ||
So you've got your NP21Kai PC-98 emulator up and running, or you've resurrected an ancient NEC PC-9801 or PC-9821 and you've decided you want to do some C programming for it. | So you've got your NP21Kai PC-98 emulator up and running, or you've resurrected an ancient NEC PC-9801 or PC-9821 and you've decided you want to do some C programming for it. | ||
- | Where do you start? Well, first, get a working development environment up and running. [[blog: | + | Where do you start? Well, first, get a working development environment up and running. [[blog: |
Next you will want to figure out how to do some interesting things with the hardware, as otherwise it's just a normal command line DOS machine.... | Next you will want to figure out how to do some interesting things with the hardware, as otherwise it's just a normal command line DOS machine.... | ||
+ | |||
+ | ===== Pre-Requisites ===== | ||
+ | |||
+ | After [[blog: | ||
+ | |||
+ | * A VCPI memory mapper running (EMM386, VEMM486 or similar) | ||
+ | * A DPMI server running | ||
+ | * A copy of GO32-V2.exe in the same directory as your application | ||
+ | |||
+ | The VCPI memory mapper should be started at boot, but the DPMI server only needs to be run at the time your application starts. | ||
+ | |||
+ | A copy of DPMI.EXE and GO32-V2.EXE are including on the development tools page. | ||
===== Non-hardware Specific Examples ===== | ===== Non-hardware Specific Examples ===== | ||
Line 229: | Line 241: | ||
</ | </ | ||
- | It is this section of code which I used to test the functionality of the various DPMI services on PC-98 DOS. The only one which would correctly return all of the various | + | It is this section of code which I used to test the functionality of the various DPMI services on PC-98 DOS. The only one which would correctly return all of the various |
//Note: You may want to create your DPMI memory info structure (__vram_dpmi__) and VRAM selector object (__vram_dpmi_selector__) as globals, since anything writing to the framebuffer (see next example, below) will need to access them.// | //Note: You may want to create your DPMI memory info structure (__vram_dpmi__) and VRAM selector object (__vram_dpmi_selector__) as globals, since anything writing to the framebuffer (see next example, below) will need to access them.// | ||
Line 243: | Line 255: | ||
* _farpokeb(), | * _farpokeb(), | ||
* _farpeekb(), | * _farpeekb(), | ||
- | * [[http:// | + | * [[http:// |
You //can//, therefore write directly to the framebuffer if you wish, but it's probably easier to create a local buffer which you write into first, compositing all of your display elements, and then transfer the entire buffer in one operation to the framebuffer hardware. | You //can//, therefore write directly to the framebuffer if you wish, but it's probably easier to create a local buffer which you write into first, compositing all of your display elements, and then transfer the entire buffer in one operation to the framebuffer hardware. |