Jump to content
IGNORED

New emulator - BuLWiP


PeteE

Recommended Posts

As some of you already know, I have been working on my own emulator for quite some time.  Mostly as an educational endeavor to test my knowledge of how our lovely machine works, and also to benchmark my own opinionated optimizations and debugging techniques.  It is written in C and uses SDL for display, and has a bespoke UI for cross-platform capability.  I've gotten a lot of ideas from other emulators: Classic99 (thanks Tursi), JS99er (thanks Rasmus), DS99 (thanks Dave), 32blit-ti99 (thanks Erik)

 

I'm not ready to publish binaries yet, but the code is here if you want to try compiling it yourself: https://github.com/peberlein/bulwip

 

image.thumb.png.7509d3987d274401b8054ef6cb927024.png

 

image.thumb.png.612ec5c259437bb84ef5bee5a8bdb2d9.png

 

This is very much a work-in-progress, and I'm aware you can't do much with only cartridge support.  I'm currently focused on making the debugger useful for developing cartridge software and showing a listing file to navigate while stepping through the code.

  • Like 24
  • Thanks 2
Link to comment
Share on other sites

@SteveB

Quote

 

My current approach works more or less with all emulators, as long you can identify the window to send the keys to. I will test in on @PeteE's BuLWiP emulator as soon as I get a pre-compiled version. I might test the option to use the clipboard, thank you for the hint.

 

I'm already thinking about TiCodEd integration, and I tried implementing the Paste functionality that Classic99 uses.  It seems to work except it exposed an emulation error when running XB.  After I get that fixed I can send you a compiled binary to play with.  Which OS do you use?

  • Like 3
Link to comment
Share on other sites

1 hour ago, PeteE said:

As some of you already know, I have been working on my own emulator for quite some time.  Mostly as an educational endeavor to test my knowledge of how our lovely machine works, and also to benchmark my own opinionated optimizations and debugging techniques.  It is written in C and uses SDL for display, and has a bespoke UI for cross-platform capability.  I've gotten a lot of ideas from other emulators: Classic99 (thanks Tursi), JS99er (thanks Rasmus), DS99 (thanks Dave), 32blit-ti99 (thanks Erik)

 

I'm not ready to publish binaries yet, but the code is here if you want to try compiling it yourself: https://github.com/peberlein/bulwip

 

image.thumb.png.7509d3987d274401b8054ef6cb927024.png

 

image.thumb.png.612ec5c259437bb84ef5bee5a8bdb2d9.png

 

This is very much a work-in-progress, and I'm aware you can't do much with only cartridge support.  I'm currently focused on making the debugger useful for developing cartridge software and showing a listing file to navigate while stepping through the code.

I have no idea what "BuLWiP" means, but... This is awesome news!

Link to comment
Share on other sites

I usually use Windows and the keyboard-integration of TiCodEd use the Win32-API, so this feature is only available on Windows.  If someone joins me for Linux "sending keystrokes from one app to another" I would try it there as well, but I am afraid this could be difficult as there are so many GUI Toolkits, Window-Manager etc. I don't have MacOS myself and @grammostola and I had not managed to get Lazaurs apps running on recent Apples, namely the M2. 

 

I would love to see an emulator where I can read the VDP RAM and send keyboard and joystick inputs... 

Link to comment
Share on other sites

39 minutes ago, jrhodes said:

I have no idea what "BuLWiP" means, but... This is awesome news!

It's from the BLWP assembly instruction.  For the application logo, I was thinking of picture of a bullwhip and a texas longhorn (not the sports team)

  • Like 6
  • Haha 1
Link to comment
Share on other sites

54 minutes ago, llabnip said:

Also you get bonus points for having a TI emulator without two 9s in the name!

I guess MAME does not count because you have to add the driver name "ti99_4a" in the command line. ;-)

 

I thought "bullwhip" is a well-known nickname for BLWP. (I think I found it in some users group publication back in those days.)

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Compiles flawlessly on my mac, and seems to work great overall, except the crt filter (just gives me a black screen) and the debugger seems to have some rendering issues as well. But, super, super impressive! I love the LCD style UI elements! I love it, and will definitely keep testing this as you continue development.

 

Perhaps some of the default shortcut key definitions are not a good fit for modern mac keyboards though, I can't remember the last time I've seen a "Home" key ;) (I changed it to F6 in code temporarily to test the debugger).

  • Like 2
Link to comment
Share on other sites

18 hours ago, llabnip said:

I’ve said it before but will repeat - your code is quite easy to read and understand. 

 

Also you get bonus points for having a TI emulator without two 9s in the name!

Thanks a lot!  Your DS99 emulator code is exquisitely commented, and also a joy to read.

 

9 hours ago, TheMole said:

Quick question: what is the format of the listing file? Would it be possible to use the output from gcc, which you can tell to spit out assembly files with interleaved c source code?

The listing format follows the output by XAS99, although I did try one listing from GCC provided by Jedimatt42.  If you DM me your listing I can try to make it work.

 

10 hours ago, TheMole said:

Compiles flawlessly on my mac, and seems to work great overall, except the crt filter (just gives me a black screen) and the debugger seems to have some rendering issues as well. But, super, super impressive! I love the LCD style UI elements! I love it, and will definitely keep testing this as you continue development.

 

Perhaps some of the default shortcut key definitions are not a good fit for modern mac keyboards though, I can't remember the last time I've seen a "Home" key ;) (I changed it to F6 in code temporarily to test the debugger).

I have the fix for the CRT filter, but haven't pushed it yet.  The CRT filter tries to read from the SDL Texture, but it's supposed to be write-only.  The fact that it works on PC is probably due to GPU driver differences.  I'll add alternate keys for Mac keyboards, thanks the heads up.

  • Like 3
Link to comment
Share on other sites

I've got a question regarding CRC and it uses during the 80s and 90s within basic and some C program listings. 

And I thought I had also seen some CRC usage during the TI coding days in the late 90s as well. Why isn't it used in assembly, Forth and rxb and other languages that are used in today's programs? What did it do that it doesn't today?

Edited by GDMike
Link to comment
Share on other sites

1 hour ago, GDMike said:

I've got a question regarding CRC and it uses during the 80s and 90s within basic and some C program listings. 

And I thought I had also seen some CRC usage during the TI coding days in the late 90s as well. Why isn't it used in assembly, Forth and rxb and other languages that are used in today's programs? What did it do that it doesn't today?

 

Well, the E/A Assembler puts a checksum on every line of output (except the last line) for the E/A Loader to verify—not exactly a CRC, but a somewhat similar kind of check.

 

...lee

  • Like 1
Link to comment
Share on other sites

On 3/2/2023 at 2:27 AM, PeteE said:

The listing format follows the output by XAS99, although I did try one listing from GCC provided by Jedimatt42.  If you DM me your listing I can try to make it work.

Here's an example cart image and the output from objdump with (some) C code interspersed... For some reason there's large swaths of asm code without C code, but that's probably because I'm including a library that hasn't been compiled/built with the right C flags. Should still work for testing if this type of list format can be made to work with you debugger though...

 

Oh, and the program itself assumes 80 column text mode on an F18A, so won't run correctly in the emulator... I hope that's not an issue for you. I just picked a small-ish project I had lying around.

malloctest8.bin malloctest8.lst

  • Like 1
Link to comment
Share on other sites

I did try to compile this on my Linux Mint 20.1 system but ran into an error:

 

~/source/bulwip$ make
cc -O3 -g   -c -o bulwip.o bulwip.c
cc -O3 -g   -c -o cpu.o cpu.c
cc -O3 -g   -c -o ui.o ui.c
cc -O3 -g -I/usr/include/SDL2 -D_REENTRANT    -c -o sdl.o sdl.c
sdl.c: In function ‘vdp_text_clear’:
sdl.c:551:2: warning: implicit declaration of function ‘SDL_LockTextureToSurface’; did you mean ‘SDL_CreateTextureFromSurface’? [-Wimplicit-function-declaration]
  551 |  SDL_LockTextureToSurface(debug_texture, &rect, &surface);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
      |  SDL_CreateTextureFromSurface
cc -O3 -g   -c -o NTSC-CRT/crt.o NTSC-CRT/crt.c
NTSC-CRT/crt.c: In function ‘init_eq’:
NTSC-CRT/crt.c:231:25: warning: right shift count is negative [-Wshift-count-negative]
  231 |         f->lf = 2 * (sn >> (15 - EQ_P));
      |                         ^~
NTSC-CRT/crt.c:237:25: warning: right shift count is negative [-Wshift-count-negative]
  237 |         f->hf = 2 * (sn >> (15 - EQ_P));
      |                         ^~
cc   bulwip.o cpu.o ui.o sdl.o NTSC-CRT/crt.o  -L/usr/lib/x86_64-linux-gnu -lSDL2  -o bulwip
/usr/bin/ld: sdl.o: in function `vdp_text_clear':
/home/ron/source/bulwip/sdl.c:551: undefined reference to `SDL_LockTextureToSurface'
/usr/bin/ld: /home/ron/source/bulwip/sdl.c:551: undefined reference to `SDL_LockTextureToSurface'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: bulwip] Error 1

 

Looks like it might be related to my version of SDL2? 2.0.10.

Thanks!

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...