1
0
mirror of https://github.com/Gehstock/Mist_FPGA.git synced 2026-01-19 09:18:02 +00:00

Super Pacman reads the inputs, but inserting a credit has an odd effect

This commit is contained in:
Jose Tejada 2021-03-09 19:31:01 +01:00
parent f1b4412be9
commit 28f3e4c47e

View File

@ -18,6 +18,36 @@
mema[4'h9] <= 0;
end
// credit management
4'h4: begin
credit_add = 0;
credit_sub = 0;
if ( iCSTART12[2] & ( credits < 99 ) ) begin
credit_add = 8'h01;
credits = credits + 1;
end
if ( mema[4'h9] == 0 ) begin
if ( ( credits >= 2 ) & iCSTART12[1] ) begin
credit_sub = 8'h02;
credits = credits - 2;
end else if ( ( credits >= 1 ) & iCSTART12[0] ) begin
credit_sub = 8'h01;
credits = credits - 1;
end
end
mema[4'h0] <= credit_add;
mema[4'h1] <= credit_sub | {7'd0,CSTART12[0]};
mema[4'h2] <= CREDIT_TENS;
mema[4'h3] <= CREDIT_ONES;
mema[4'h4] <= STKTRG12[3:0];
mema[4'h5] <= { CSTART12[0], iCSTART12[0], STKTRG12[4], iSTKTRG12[4] };
mema[4'h6] <= STKTRG12[9:6];
mema[4'h7] <= { CSTART12[1], iCSTART12[1], STKTRG12[10], iSTKTRG12[10] };
end
4'h8: begin // Boot up check, expected values by
// the software (Super Pacman, Motos $69, Phozon $1C)
mema[4'h0] <= 4'h6;