Apple ][+ Core

https://github.com/mist-devel/mist-board/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Moderator Team

NML32
Atari Super Hero
Atari Super Hero
Posts: 648
Joined: Tue Mar 11, 2014 1:54 am
Location: USA/Florida

Apple ][+ Core

Postby NML32 » Sat Aug 16, 2014 7:21 pm

@wsoltys thanks for adding another core. :)
Hopefully you'll find a solution for the joystics.

From the readme.txt:

This the MiST port of a reconstruction of an 1980s-era Apple ][+ implemented in VHDL for FPGAs.

Original for the DE2: http://www1.cs.columbia.edu/~sedwards/apple2fpga/
Port for the MiST: http://ws0.org/tag/apple2/
Sources: https://github.com/wsoltys/mist-cores/t ... apple2fpga

On the "Apple ][" boot screen open the OSD with F12 and choose a nibblelized disk. It will boot
the disk automatically. Use dsk2nib to convert AppleII disk images to .nib images.
The disk emulation is read only.

If you press reset (the right button on the MiST) you'll enter Applesoft with the ] prompt.
From here you have some limited commands. See: http://www.landsnail.com/a2ref.htm
If you want to boot another disk choose a .nib image via the osd and type the following:

]CALL -151
*C600G

The call command will enter the Monitor. Type the call a second time if the * prompt won't
show the first time.
At the Monitor you can also type 6 and then Ctrl-P followed by return.
See http://vectronicsappleworld.com/appleii ... ml#bootdos

Currently the joystick is attached to the paddle ports. It won't work nicely as the paddle/joystick
was analogue and the MiST joystick sends digital signals.

wsoltys
Atari maniac
Atari maniac
Posts: 75
Joined: Wed Mar 19, 2014 9:11 pm
Contact:

Re: Apple ][+ Core

Postby wsoltys » Sat Aug 16, 2014 8:25 pm

You're welcome.
Currently I get a "we're sorry..." page from Google when trying to download .exe files. Meanwhile get the dsk2nib.exe file from here: https://github.com/wsoltys/mist-cores/b ... sk2nib.exe

eeun
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 128
Joined: Mon Sep 10, 2007 2:49 am
Location: Ontario, Canada

Re: Apple ][+ Core

Postby eeun » Sat Aug 16, 2014 11:42 pm

Just because I found it before finding an alt .exe download location, I used the .jar file from here on Windows 7 x64:

http://boutillon.free.fr/Underground/Ou ... k2nib.html

entering

Code: Select all

java -jar dsk2nib.jar 1 *.dsk

will batch 'nibblify' the .dsk files in a directory.

Thanks, wsoltys! Just booted Bruce Lee. 8)

Am I mistaken, or is MiST now leading the FPGA pack for number of available cores?

wsoltys
Atari maniac
Atari maniac
Posts: 75
Joined: Wed Mar 19, 2014 9:11 pm
Contact:

Re: Apple ][+ Core

Postby wsoltys » Sun Aug 17, 2014 9:01 am

Beside the joystick issue the colors seems to be a little off. It might be that this is also with the original port: http://www1.cs.columbia.edu/~sedwards/apple2fpga/
I'll look at both when I have time.

wsoltys
Atari maniac
Atari maniac
Posts: 75
Joined: Wed Mar 19, 2014 9:11 pm
Contact:

Re: Apple ][+ Core

Postby wsoltys » Sun Aug 17, 2014 9:52 am

Got the colors fixed. I've have a look at the joystick later.

NML32
Atari Super Hero
Atari Super Hero
Posts: 648
Joined: Tue Mar 11, 2014 1:54 am
Location: USA/Florida

Re: Apple ][+ Core

Postby NML32 » Sun Aug 17, 2014 1:23 pm

wsoltys wrote:Got the colors fixed. I've have a look at the joystick later.


That's good news. :D looking forward to joystick fix.

Thanks.

User avatar
Paradroyd
Captain Atari
Captain Atari
Posts: 293
Joined: Tue Sep 10, 2013 10:50 pm
Contact:

Re: Apple ][+ Core

Postby Paradroyd » Mon Aug 18, 2014 4:03 am

It's quite cool that this exists at all. I was online checking for updates to other cores earlier and discovered this. Nice surprise!

I have a lot to figure out with it. I have the core up and running and tons of .nib images, but I know just barely more about using an Apple II than I do about using a ZX Spectrum (not much).

The MIST has already evolved way past my most optimistic expectations!

Now if someone comes up with a working TI99/4A core that can load cartridge images, I might have to buy a second MIST for the office..
- Paradroyd
@paradroyd on Twitter, @paradroyd@mastodon.sdf.org on Mastodon

wsoltys
Atari maniac
Atari maniac
Posts: 75
Joined: Wed Mar 19, 2014 9:11 pm
Contact:

Re: Apple ][+ Core

Postby wsoltys » Mon Aug 18, 2014 6:46 pm

I've uploaded a new version. The color seems to be fixed and I got the joystick somewhat working. The yellow LED indicates disk access now.
The problem with the joystick is that the apple converts the analog input to values from 0 to 255 per axis. 0 means full left and 255 full right. Center is around 127. Since I had to implement a counter to count micro seconds after triggered I can only come near to the values I want to have.
I still can't "rotate" the heli in choplifter but steering works now. In Loderunner I can't go right, dunno why.

NML32
Atari Super Hero
Atari Super Hero
Posts: 648
Joined: Tue Mar 11, 2014 1:54 am
Location: USA/Florida

Re: Apple ][+ Core

Postby NML32 » Tue Aug 19, 2014 10:46 pm

eeun wrote:Just because I found it before finding an alt .exe download location, I used the .jar file from here on Windows 7 x64:

http://boutillon.free.fr/Underground/Ou ... k2nib.html

entering

Code: Select all

java -jar dsk2nib.jar 1 *.dsk

will batch 'nibblify' the .dsk files in a directory.

Thanks, wsoltys! Just booted Bruce Lee. 8)

Am I mistaken, or is MiST now leading the FPGA pack for number of available cores?


Thanks, this made the conversion much easier.

wsoltys
Atari maniac
Atari maniac
Posts: 75
Joined: Wed Mar 19, 2014 9:11 pm
Contact:

Re: Apple ][+ Core

Postby wsoltys » Wed Aug 20, 2014 7:11 pm

I've uploaded a new core with adjusted joystick values. They now have the min/center/max analog values 0/127/255.

User avatar
Paradroyd
Captain Atari
Captain Atari
Posts: 293
Joined: Tue Sep 10, 2013 10:50 pm
Contact:

Re: Apple ][+ Core

Postby Paradroyd » Thu Aug 21, 2014 5:13 pm

wsoltys wrote:I've uploaded a new core with adjusted joystick values. They now have the min/center/max analog values 0/127/255.


This is working pretty well. I just played Beach-Head on it and everything just worked.

Thanks!
- Paradroyd
@paradroyd on Twitter, @paradroyd@mastodon.sdf.org on Mastodon

User avatar
Newsdee
Atari God
Atari God
Posts: 1508
Joined: Fri Sep 19, 2014 8:40 am

Re: Apple ][+ Core

Postby Newsdee » Fri Sep 19, 2014 8:48 am

which USB joysticks have you tried on which core revision? I tried a few gamepads but only the fire button is recognized. They work with the ST core though.

Edit: OK I got it... turned out the firmware needed upgrading (should have followed all the setup instructions!) and I had to swap joysticks.

Happy to report that analog sticks are working... used a Retrolink N64 gamepad replica to try.

User avatar
Newsdee
Atari God
Atari God
Posts: 1508
Joined: Fri Sep 19, 2014 8:40 am

Re: Apple ][+ Core

Postby Newsdee » Sat Sep 20, 2014 10:03 am

Found an interesting snippet of Verilog posted by Alex Freed in another forum - logic for a "Language Card" expansion which is missing from Apple2FPGA:
http://comp.sys.apple2.narkive.com/VcbK ... -schematic

This card expands the total RAM to 64K, increasing compatibility with many games (e.g. Impossible Mission).
Obviously would be a very nice addition to the MiST apple2 core :)

I felt bold so tried to add it myself to the core in Quartus II (I'm a total beginner in VHDL/Verilog, but seasoned programmer) - unfortunately I can't get it recognized as a Design Unit.
Am I missing something obvious? And once I have it recognized, is it just a matter of mapping the ports, or will I need to do something to reserve more SDRAM?


Here is the code in case the other page goes down:

Code: Select all

module ramcard(mclk28,reset_in,strobe,addr,ram_addr, we,
card_ram_we,card_ram_rd, bank1);
input mclk28;
input reset_in, strobe;
input [15:0] addr;
output [15:0] ram_addr;
input we;
output card_ram_we;
output card_ram_rd;
output bank1;

reg bank1, read_en, write_en, pre_wr_en;
wire Dxxx;

always @(posedge mclk28) begin
if(reset_in) begin
bank1 <= 0;
read_en <= 0;
write_en <= 1;
pre_wr_en <= 0;
end else begin
if((addr[15:4] == 'hC08) & strobe) begin
bank1 <= addr[3];
pre_wr_en <= addr[0] & ~we;
write_en <= addr[0] & pre_wr_en & ~we;
read_en <= ~(addr[0] ^ addr[1]);
end
end
end

assign Dxxx = (addr[15:12] == 4'b1101);
assign ram_addr = {addr[15:13], addr[12] & ~(bank1 & Dxxx) , addr[11:0]};
assign card_ram_we = write_en;
assign card_ram_rd = read_en;

endmodule

wsoltys
Atari maniac
Atari maniac
Posts: 75
Joined: Wed Mar 19, 2014 9:11 pm
Contact:

Re: Apple ][+ Core

Postby wsoltys » Sun Sep 21, 2014 7:37 pm

I know the code and tried to implement my own version to learn more rather than only do porting :)
But the problem is that the MiST internal RAM is almost full and the additional 16KB won't fit. Therefore I tried to use sdram as main ram which works well but hit another problem. I use sdram as well for the disk storage and thus need to multiplex the access to it. It works fine sometimes and later it fails so I didn't find the right time slot between cpu, video and disk access yet. You are welcome to help with it: https://github.com/wsoltys/mist-cores/t ... apple2fpga

Once main ram is working with sdram we can use the internal ram for the language card to ease access.

User avatar
Newsdee
Atari God
Atari God
Posts: 1508
Joined: Fri Sep 19, 2014 8:40 am

Re: Apple ][+ Core

Postby Newsdee » Mon Sep 22, 2014 2:09 am

wsoltys wrote:I didn't find the right time slot between cpu, video and disk access yet. You are welcome to help with it: https://github.com/wsoltys/mist-cores/t ... apple2fpga
Once main ram is working with sdram we can use the internal ram for the language card to ease access.


I've managed to compile it but I'm an absolute beginner at FPGAs and verilog/vhdl. :-) (mostly programmer but familiar with low level stuff)

I wonder: would it be possible to configure part of the FPGA as 128K of RAM? That should be enough to support an Apple //e.

wsoltys
Atari maniac
Atari maniac
Posts: 75
Joined: Wed Mar 19, 2014 9:11 pm
Contact:

Re: Apple ][+ Core

Postby wsoltys » Mon Sep 22, 2014 7:25 am

Thats how I started recently and I'm still a noob with the hdl stuff ;)
Unfortunately the C3 inside the MiST only has 76kb of block/internal ram which is occupied by the Apple main ram, bios and disk rom. To use 128kb we are back using sdram with the problems I mentioned in the other post.
Just using more ram in the core won't help either as the Apple can only address 16 bit (64kb) which is used for the ram and the bios. you need a kind of bank switching. Further more you have to take the changed hardware into account and rebuild that in hdl.

User avatar
Newsdee
Atari God
Atari God
Posts: 1508
Joined: Fri Sep 19, 2014 8:40 am

Re: Apple ][+ Core

Postby Newsdee » Mon Sep 22, 2014 3:08 pm

I'd expect the original Apple hardware (converted to HDL) to handle the bank switching of its RAM, no?
But I think we need to define a map on the real ram, automatically offsetting the start address requested by the CPU:

  • 0 to 48K: base RAM
  • 49K to 64K: language card
  • 64K to 128K : 80 column expansion card (seems simpler than the language card unless its 2 IC are complex)
  • 128K to 256K: disk drive 1
  • 256K to 384K: disk drive 2

wsoltys
Atari maniac
Atari maniac
Posts: 75
Joined: Wed Mar 19, 2014 9:11 pm
Contact:

Re: Apple ][+ Core

Postby wsoltys » Mon Sep 22, 2014 4:33 pm

What is "the original Apple hardware"? All cores define what they need and it isn't a 100% copy of the real hw. This is just an AppleII+ core and one has to write or to copy the banking and other stuff from other cores.
But this isn't the issue. Currently we can either choose more RAM or using the disk drive. Thats because the core gets the disk images from the arm firmware and needs to store it in memory.
Thats MiST specific as the boards used by other ports often have flash memory and/or external sram.

User avatar
Newsdee
Atari God
Atari God
Posts: 1508
Joined: Fri Sep 19, 2014 8:40 am

Re: Apple ][+ Core

Postby Newsdee » Mon Sep 22, 2014 10:58 pm

I suppose another option would be to integrate the SD card as disk drive, but that might be harder than multiplexing the RAM.
So probably out of reach right now, but it has been done and there is an HDL file for it: http://dreher.net/?s=projects/CFforAppl ... /logic.php

For now... on a smaller scale, do you think it's feasible to add a .dsk to .nib on-the-fly converter?
.dsk is the most common extension used out there, and it seems it only needs padding data. I suppose the question is whether firmware can provide independent ways of loading separate filetypes?

Also for those that might not know, there is a massive archive out there ("Asimov") with Apple II disks:
http://mirrors.apple2.org.za/ftp.apple. ... ges/games/

User avatar
remowilliams
Captain Atari
Captain Atari
Posts: 246
Joined: Mon Apr 02, 2007 1:49 am

Re: Apple ][+ Core

Postby remowilliams » Fri Sep 26, 2014 3:15 pm

Analog sticks are implemented as paddles? I tried walking around in Wolfenstein and that didn't seem to go very well :)

User avatar
Newsdee
Atari God
Atari God
Posts: 1508
Joined: Fri Sep 19, 2014 8:40 am

Re: Apple ][+ Core

Postby Newsdee » Sat Sep 27, 2014 12:01 am

You need to use a USB analog stick.
I've successfully used a N64 USB pad replica, but it's a bit sensitive due to small deadzone (could be the stick, haven't tried others).

User avatar
remowilliams
Captain Atari
Captain Atari
Posts: 246
Joined: Mon Apr 02, 2007 1:49 am

Re: Apple ][+ Core

Postby remowilliams » Sat Sep 27, 2014 2:40 pm

Yes I was using an analog USB stick and had the controls set to swapped. Point being (aside from Mr. Wolfenstein walking off in every direction except the desired one) are games supposed to be set for Paddle(0) instead of Joystick?

User avatar
Newsdee
Atari God
Atari God
Posts: 1508
Joined: Fri Sep 19, 2014 8:40 am

Re: Apple ][+ Core

Postby Newsdee » Tue Sep 30, 2014 3:49 pm

IIRC the apple2 doesn't distinguish between 2 paddles and 1 joystick. Paddle(0) is literally the X axis with button 0.

Wolfenstein should allow you to choose whether to play with paddles or joystick, I think.
Some games assume Paddles though, e.g. Sneakers.

zzd10h
Atariator
Atariator
Posts: 24
Joined: Mon Dec 22, 2014 6:53 pm

Re: Apple ][+ Core

Postby zzd10h » Mon Dec 22, 2014 8:56 pm

Hi,
nice to play again to Conan or to Montezuma's Revenge.

Thank you for this core :D


By the way,

1) "If you press reset (the right button on the MiST) you'll enter Applesoft with the ] prompt."

For me, the rightmost button doesn't bring the Apple prompt, I have to reboot each time that I want to change .nib file.
Does this button still work for you with the latest core ?

2) And is anybody succeed to pass the intro screen of Rescue Raider ?

Thank you

wsoltys
Atari maniac
Atari maniac
Posts: 75
Joined: Wed Mar 19, 2014 9:11 pm
Contact:

Re: Apple ][+ Core

Postby wsoltys » Tue Dec 23, 2014 10:37 am

When pressing soft reset (the right MiST button) the AppleII core will still see the last disk inserted and start it accordingly. While in the game you can change the disk and press the reset button to start the new game. This will work on most games.
I can "reset" the last inserted disk so that the reset button will bring you to the apple prompt but I find it easier the way it is. Opinions?


Return to “MiST”

Who is online

Users browsing this forum: No registered users and 5 guests