• Please review our updated Terms and Rules here

Search results

  1. M

    EGA PEL panning & scanlines

    Thanks for testing.
  2. M

    PC BIOS function int 21, 48

    If someone is interested, I managed to replace all turbo c library functions with bios/dos int calls, (all file related functions, setvect getvect, sleep, exit etc...). Now I can use this 21h,48 function with no issues, so there was some bug in turbo c. I still need the c0c.obj (compact memory...
  3. M

    PC BIOS function int 21, 48

    Thanks for testing. I just want to make my game engine library (and the final exe) as small as possible, by being independent of any turbo c or watcom library, using all dos (I think dos 4.0 will be the minimum required) and bios functions. I don't really need to do this, it's just for the fun...
  4. M

    PC BIOS function int 21, 48

    I managed to create a minimal sample which replicated the problems of my program: #include <stdio.h> #include <stdlib.h> #include <dos.h> typedef unsigned short word; void far *_malloc(word para){ word addr = 0; asm mov ah,48h asm mov bx,para asm int 21h asm jc _error...
  5. M

    PC BIOS function int 21, 48

    I surely forgot to add a "far" somewhere in my code, your sample works well :)
  6. M

    PC BIOS function int 21, 48

    Thanks for the info, I tested that and it does not solve the problem. Reading some old posts about using this dos int, I found why it is failing in my code. If you use this int 21,48 function, you can't use any malloc, calloc or any other related function which uses malloc internaly in the...
  7. M

    PC BIOS function int 21, 48

    Thanks. I only need conventional memory, and not a lot of it, (around 192K + program code + variables), this is a program for 8088 cpus.
  8. M

    PC BIOS function int 21, 48

    Well this function causes a lot of trouble, I looked at the turbo c malloc source, and it is a huge piece of code which does not use this int 21 function, or it uses it in a way I could not understand. I tried resizing the MCB (the block the exe file allocates) but that was not working at all.
  9. M

    PC BIOS function int 21, 48

    Thanks, I'm using all bios/dos functions so I don't have to use libraries (from turbo c at the moment)
  10. M

    PC BIOS function int 21, 48

    Thanks, I understand now. My code was working because the program was doing nothing else.
  11. M

    PC BIOS function int 21, 48

    I tried using my own simple malloc by calling this bios function. Again in MS-DOS real mode. This bios function returns a 16 bit number and I don't really know if my code is correct to convert it to the actual address: word _malloc(word para){ word addr = 0; asm mov ah,48h asm mov...
  12. M

    MS-DOS Reading keyboard port (60 61) without interrupts

    I finally used the interrupt 9 with a custom function, because reading keys only at vsync was causing trouble in some emulators/real machines. It is also very fast and it did not affect the game speed (even at 4.77 MHz). The only bad thing is, I have to read the joystick with a separate...
  13. M

    MS-DOS Reading keyboard port (60 61) without interrupts

    I tested that in a simple program which does nothing else after that, I think I'll just use the interrupt 9 to read the keyboard and then update my "pushed/released keys array" only at vsync. It seems the "less buggy" option. I just realized it works on some emulators and it doesn't on others...
  14. M

    MS-DOS Reading keyboard port (60 61) without interrupts

    I tried that, and it did not work as I expected, this should ignore the keyboard, but it does not: asm in al, 21h //Read existing bits. asm or al, 02h //Turn off IRQ 1 (KEYBOARD) asm out 21h, al //Write result back to PIC.
  15. M

    MS-DOS Reading keyboard port (60 61) without interrupts

    I inserted a null function at interrupt 9, so I guess I disabled the keyboard. Then I used this every vsync (set to 60Hz): void Key_Handler(void){ asm{ cli in al, 060h //READ KEYBOARD PORT mov keyhit, al //Store in keyhit in al, 061h //READ SYSTEM...
  16. M

    MS-DOS Reading keyboard port (60 61) without interrupts

    I'm adding joystick support for my engine, and It is simpler to read joystick and keyboard at the same time after waiting for vsync. All keyboard functions and info I find, suggests I should read 0x60 port by inserting a custom function in interrupt vector 9. Will there be any problem with the...
  17. M

    EGA PEL panning & scanlines

    I was programming copper bars for VGA, they require at least a 286 to wait 2 scanlines. Scanlines are drawn too fast for slower cpus to get the hsync on time, using in/out instructions and loops.
  18. M

    EGA PEL panning & scanlines

    Just realized EGA cards on mode 0D, work with 200 real scanlines, and slow CPUs can read hsync and wait. But VGA cards output 400 scanlines, so it is not possible for slow CPUS to handle this kind of code unless you configure the card to output 15KHz, and most modern monitors won't support it.
  19. M

    EGA PEL panning & scanlines

    I can't test this on a real PC, your idea should be fast enough for the 8086 4.77 (on Dosbox-x it worked with a 200 cycle CPU). I'd also love to see this on VGA cards, and also a way to update the start address offset every scanline, (to make huge fake parallax). I posted a bug on 86Box...
  20. M

    EGA PEL panning & scanlines

    There you have it, It works with around 380 cycles on dosbox-x, (that's more or less an 8086-8MHz). To make it work on 8088s we have to calculate the cycles for every EGA scanline, (like they did for CGA, and the 8088mph / area5150 demos).
Back
Top